#35070 [Fbk->Csd]: next() does not work with global variable
| From: | iliaa@php.net | Date: | Wed, 02 Nov 2005 19:47:59 +0000 |
| Subject: | #35070 [Fbk->Csd]: next() does not work with global variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-87432@lists.php.net to get a copy of this message | ||
ID: 35070
Updated by: iliaa@php.net
Reported By: tokul at users dot sourceforge dot net
-Status: Feedback
+Status: Closed
Bug Type: Arrays related
Operating System: Linux Debian Sarge
PHP Version: 4.4.1
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-11-02 20:47:06] derick@php.net
Please the next snapshot, sometimes there is a short delay.
------------------------------------------------------------------------
[2005-11-02 20:43:13] tokul at users dot sourceforge dot net
I know about 35067 bug, but it is still reproducable in
php4-STABLE-200511021752
------------------------------------------------------------------------
[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