php.net |  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
Votes:10
Avg. Score:3.6 ± 0.8
Reproduced:4 of 5 (80.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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ceo at l-i-e dot com
New email:
PHP Version: OS:

 

 [2005-01-01 21:16 UTC] ceo at l-i-e dot com
Description:
------------
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.



Patches

reset_end_with_offset.patch.txt (last revision 2011-08-23 16:14 UTC by datibbaw@php.net)

Pull Requests

Pull requests:

History

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

Patch Name: reset_end_with_offset.patch.txt
Revision:   1314116064
URL:        https://bugs.php.net/patch-display.php?bug=31375&patch=reset_end_with_offset.patch.txt&revision=1314116064
 [2014-03-06 13:32 UTC] narf at devilix dot net
+1
 [2014-04-17 14:39 UTC] levim@php.net
-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] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: datibbaw +Assigned To:
 [2020-09-18 12:10 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2020-09-18 12:10 UTC] cmb@php.net
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] <https://github.com/php/php-src/pull/645>
[2] <https://www.php.net/mailing-lists.php#internals>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC