PHP 4.0 Bug #8353: foreach modify array pointer

From: Date: Thu, 21 Dec 2000 14:44:03 +0000
Subject: PHP 4.0 Bug #8353: foreach modify array pointer
Groups: php.dev 
Request: Send a blank email to php-dev+get-42047@lists.php.net to get a copy of this message
From: lunepi@comlink.org Operating system: PHP version: 4.0.4 PHP Bug Type: Arrays related Bug description: foreach modify array pointer try 1.: $var[] = "1"; $var[] = "2"; foreach($var as $test) { echo $test; } reset($var); echo current($var); output -> 12 then try: $var[] = "1"; $var[] = "2"; //reset($var); foreach($var as $test) { echo $test; current($var); } echo current($var); output -> 121 this should be the output of the first script too? Greetings lunepi -- Edit Bug report at: http://bugs.php.net/?id=8353&edit=1

« previous php.dev (#42047) next »