ID: 35084 User updated by: margus at zone dot ee Reported By: margus at zone dot ee -Status: Feedback +Status: Closed Bug Type: Scripting Engine problem Operating System: SuSE 9.0 PHP Version: 4.4.1 New Comment:
yes, CVS snapshot (php4-STABLE-200511030951) is working Previous Comments: ------------------------------------------------------------------------ [2005-11-03 11:57:40] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2005-11-03 11:57:04] margus at zone dot ee OS is SuSE 9.0 ------------------------------------------------------------------------ [2005-11-03 11:51:49] margus at zone dot ee 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35084&edit=1