|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #31375 array_set_current
Submitted: 2005-01-01 21:16 UTC Modified: 2020-09-18 12:10 UTC
Avg. Score:3.6 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: ceo at l-i-e dot com Assigned:
Status: Suspended Package: Arrays related
PHP Version: * OS: Irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-01-01 21:16 UTC] ceo at l-i-e dot com
While messing around with next/current/end/prev on large arrays, it became apparent that there is a gaping hole in functionality:

I can't set the current internal pointer of the array to an arbitrary value. :-(

I have to walk through the whole array to the element I want as my 'current'

An array_set_current function which takes an array and integer to set the current internal pointer to the N'th element is pretty important for quickly starting off at the right place in my array.


reset_end_with_offset.patch.txt (last revision 2011-08-23 16:14 UTC by

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-23 16:14 UTC]
The following patch has been added/updated:

Patch Name: reset_end_with_offset.patch.txt
Revision:   1314116064
 [2014-03-06 13:32 UTC] narf at devilix dot net
 [2014-04-17 14:39 UTC]
-Package: Feature/Change Request +Package: Arrays related -Operating System: All +Operating System: Irrelevant -PHP Version: Irrelevant +PHP Version: * -Assigned To: +Assigned To: datibbaw
 [2017-10-24 07:12 UTC]
-Status: Assigned +Status: Open -Assigned To: datibbaw +Assigned To:
 [2020-09-18 12:10 UTC]
-Status: Open +Status: Suspended
 [2020-09-18 12:10 UTC]
As the discussion on the related pull request ticket[1] shows,
this feature appears to be somewhat controversial.  As such it
needs to be further discussed, which is beyond the scope of this
bug tracker.  So whoever is interested in having this, should
write mail to the PHP internals mailing list[2].  For the time
being, I'm suspending this ticket.

[1] <>
[2] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Jul 28 08:01:24 2021 UTC