#40768 [Opn->Csd]: nested foreach break -- infinite loop - serious

From: Date: Fri, 09 Mar 2007 18:30:56 +0000
Subject: #40768 [Opn->Csd]: nested foreach break -- infinite loop - serious
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110154@lists.php.net to get a copy of this message
ID: 40768 User updated by: abc at def dot ghi Reported By: abc at def dot ghi -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: winxp PHP Version: 5.2.1 New Comment: me again, i just tried latest snapshot and it works fine there so i guess new snapshot should be released as i walked around some other strange things in that current 5.2.1. Previous Comments: ------------------------------------------------------------------------ [2007-03-09 18:20:01] abc at def dot ghi wonder if someone can check this on linux build if its win issue. ------------------------------------------------------------------------ [2007-03-09 18:13:08] abc at def dot ghi Description: ------------ i use just build i downloaded from site (5.2.1) no exts, no optimizers. it seem the $a,$b keep same internal pointer, this is quite serious error cos $b=$a should create separate array copy and it does but without the inner pointer. if you replace $b=$a with $b=array(1,2,3); it works as expected this was reported and ignored by someone on solaris before as well-- #40608 Reproduce code: --------------- $a=array(1,2,3); $b=$a; foreach($a as $A) { foreach($b as $B) { echo "$A,$B\n"; break; } } Expected result: ---------------- 1,1 2,1 3,1 Actual result: -------------- 1,1 2,1 3,1 2,1 3,1 2,1 3,1 --infinite- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40768&edit=1

« previous php.bugs (#110154) next »