PHP 4.0 Bug #8353 Updated: foreach modify array pointer
| From: | sniper@php.net | Date: | Sat, 10 Mar 2001 02:32:57 +0000 |
| Subject: | PHP 4.0 Bug #8353 Updated: foreach modify array pointer | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-48552@lists.php.net to get a copy of this message | ||
ID: 8353
Updated by: sniper
Reported By: lunepi@comlink.org
Old-Status: Feedback
Status: Closed
Bug Type: Arrays related
Assigned To:
Comments:
no feedback.
Previous Comments:
---------------------------------------------------------------------------
[2001-01-05 22:52:10] sniper@php.net
I get 121 for both cases. Please try the latest snapshot from http://snaps.php.net/
--Jani
---------------------------------------------------------------------------
[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
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8353&edit=2