PHP 4.0 Bug #8353 Updated: foreach modify array pointer
| From: | sniper@php.net | Date: | Sat, 06 Jan 2001 03:52:10 +0000 |
| Subject: | PHP 4.0 Bug #8353 Updated: foreach modify array pointer | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-43117@lists.php.net to get a copy of this message | ||
ID: 8353
Updated by: sniper
Reported By: lunepi@comlink.org
Old-Status: Open
Status: Feedback
Bug Type: Arrays related
Assigned To:
Comments:
I get 121 for both cases. Please try the latest snapshot from http://snaps.php.net/
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-12-21 09:44:03] lunepi@comlink.org
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
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8353