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: 2017-10-24 07:12 UTC
Votes:9
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: Open 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
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)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

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:
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:25 2019 UTC