|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-03 11:57 UTC] margus at zone dot ee
[2005-11-03 11:57 UTC] derick@php.net
[2005-11-03 12:16 UTC] margus at zone dot ee
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 23:00:01 2025 UTC |
Description: ------------ I have reference to array and iterating through the array using current()/next() loop The problem is, that $element = current($arr_ref) returns always the first element in array regardless of multiple next($arr_ref) calls before current(...) ----- It worked in php4.4.0. At the moment the only workaround is to replace everywhere in code: $element = current ($arr_ref) to $element = current(& $arr_ref); Reproduce code: --------------- $a = array('foot', 'bike'); reset ($a); next($a); echo "A:" . current ($a) . "<BR>"; $b =& $a; reset ($b); next($b); echo "B:" . current ($b) . "<BR>"; Expected result: ---------------- A:bike B:bike Actual result: -------------- A:bike B:foot