ID: 50582 Updated by: [email protected] Reported By: mwacker at cornellsun dot com -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Ubuntu 9.10 PHP Version: 5.3.1 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2009-12-26 22:48:18] mwacker at cornellsun dot com Description: ------------ A variable acts weird when it is used as a reference variable inside a foreach loop and then as a regular variable inside a foreach loop. (Originally seen in 5.2.10-2ubuntu6.3, repro'd in a fresh 5.3.1 install) Reproduce code: --------------- $ii = array(1, 2, 3); foreach ($ii as &$i) echo $i; foreach ($ii as $i) echo $i; Expected result: ---------------- 123123 Actual result: -------------- 123122 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50582&edit=1
