#35070 [Csd->Opn]: next() does not work with global variable
| From: | tokul at users dot sourceforge dot net | Date: | Wed, 02 Nov 2005 19:43:16 +0000 |
| Subject: | #35070 [Csd->Opn]: next() does not work with global variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-87430@lists.php.net to get a copy of this message | ||
ID: 35070
User updated by: tokul at users dot sourceforge dot net
Reported By: tokul at users dot sourceforge dot net
-Status: Closed
+Status: Open
Bug Type: Arrays related
Operating System: Linux Debian Sarge
PHP Version: 4.4.1
New Comment:
I know about 35067 bug, but it is still reproducable in
php4-STABLE-200511021752
Previous Comments:
------------------------------------------------------------------------
[2005-11-02 19:06:22] tokul at users dot sourceforge dot net
missed other report
------------------------------------------------------------------------
[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