|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-05 16:37 UTC] sniper@php.net
[2006-02-10 20:48 UTC] brion at wikimedia dot org
[2007-01-10 16:01 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
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