ID:               41372
 Updated by:       [EMAIL PROTECTED]
 Reported By:      forjest at gmail dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         Arrays related
 Operating System: WinXP, Linux
 PHP Version:      5.2.1, 4.4.7
 Assigned To:      dmitry
 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:
------------------------------------------------------------------------

[2007-07-24 18:30:17] [EMAIL PROTECTED]

The bug is not related to #40509 and #40705

------------------------------------------------------------------------

[2007-07-14 10:15:21] [EMAIL PROTECTED]

Dmitry, check this out too, along with all those other reports about
same issue.. :)

------------------------------------------------------------------------

[2007-05-16 13:44:46] forjest at gmail dot com

I'm described problem, that is not foreach related. Just
1. Straight copy from one global scope variable to another
2. Copy from current runing context to global variable.

Not iterating local varibale after copying element of global array.
This is another bug, but may be from same "family".
And please remember another one http://bugs.php.net/bug.php?id=37715
Problem appeared at 4.4.2 and 5.1.2 and was reported year ago...

May be I'm described duplicate of "This is expected and not going to be
changed" bug instead of assigned 'foreach' bug?

------------------------------------------------------------------------

[2007-05-16 13:01:18] [EMAIL PROTECTED]

Duplicate of bug #40509.

------------------------------------------------------------------------

[2007-05-12 10:10:17] forjest at gmail dot com

/*for simple case just wrap array in some array function. That will
cause small overhead, but at least save your internal pointer*/
$Foo = array('val1', 'val2', 'val3');
end($Foo);
var_dump(key($Foo));
$AllOkay = array_merge($Foo);
var_dump(key($Foo));

----------
/*But to make immune running context for error handler function nothing
helps, except ugly serialize/unserialize solution*/

error_reporting(E_ALL); 
function TestErrorHandler($severity, $message, $filename, $line,
$super_globals) 
{ 
    global $foo;
    $foo = unserialize(serialize($super_globals));
} 

class Test  
{ 
     function run()  
     { 
          $Res = array('val1', 'val2', 'val3'); 
          end($Res); 
          var_dump(key($Res)); 
          HEY;//raise notice error 
          var_dump(key($Res));      
     } 
} 
$test = new Test(); 
set_error_handler('TestErrorHandler'); 
$test-> run();

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/41372

-- 
Edit this bug report at http://bugs.php.net/?id=41372&edit=1

Reply via email to