ID: 35070
User updated by: tokul at users dot sourceforge dot net
Reported By: tokul at users dot sourceforge dot net
-Status: Open
+Status: Closed
Bug Type: Arrays related
Operating System: Linux Debian Sarge
PHP Version: 4.4.1
New Comment:
missed other report
Previous Comments:
------------------------------------------------------------------------
[2005-11-02 19:03:12] tokul at users dot sourceforge dot net
Description:
------------
next() does not advance the internal array pointer, if it is run on
global variable inside function.
Reproduce code:
---------------
global $test;
$test=array(1=>'one',2=>'two',3=>'three');
function test() {
global $test;
echo current($test)."\n";
next($test);
echo current($test)."\n";
next($test);
echo current($test)."\n";
}
test();
Expected result:
----------------
one
two
three
Actual result:
--------------
one
one
one
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35070&edit=1