ID: 35106 Updated by: [EMAIL PROTECTED] Reported By: olympnn at nm dot ru -Status: Open +Status: Assigned -Bug Type: Arrays related +Bug Type: Scripting Engine problem -Operating System: Windows XP Sp2 +Operating System: * -PHP Version: 5.0.5 +PHP Version: 5CVS-2005-11-05 (cvs) -Assigned To: +Assigned To: dmitry New Comment:
Verified. Dmitry, check this out. Previous Comments: ------------------------------------------------------------------------ [2005-11-04 16:57:11] olympnn at nm dot ru Description: ------------ When I execute the code, it seems that the outer foreach is executed only once. When I comment any of lines marked *, the (outer) foreach executes twice. This bug seems to be very like to bug # 21702, but here the situation is much more strange: I do not use $b in foreaches at all! So it's very strange that the foreach behavior differs when the array was referenced sometime or not. Thanks. Reproduce code: --------------- <? $a=array("1","2"); $b=&$a;//* foreach($a as $i){ print($i); foreach($a as $p);//* } ?> Expected result: ---------------- 12 Actual result: -------------- 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35106&edit=1