ID:               48875
 Comment by:       stepheneliotdewey at gmail dot com
 Reported By:      stepheneliotdewey at gmail dot com
 Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: Vista 64-bit
 PHP Version:      5.2.10
 New Comment:

I should note that I first saw this bug in a comment posted earlier
today in the documentation:

http://us3.php.net/manual/en/control-structures.foreach.php#92116


Previous Comments:
------------------------------------------------------------------------

[2009-07-10 00:36:21] stepheneliotdewey at gmail dot com

Description:
------------
If you look at the final print-out for the below, it will print a, b,
b, instead of the expected a, b, c. I don't think this is the expected
behavior.

Reproduce code:
---------------
<?php
    $a = array('a', 'b','c');
    foreach($a as &$row){
        //you don't have to do anything here
       }
    print_r($a);
    foreach($a as $row){
       echo "<br />".$row;
    }
?>

Expected result:
----------------
a
b
c

Actual result:
--------------
a
b
b


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


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

Reply via email to