Ask a Question related to PHP Bugs, Design and Development.
-
rave235 at gmail dot com #1
#40768 [NEW]: nested foreach break -- infinite loop - serious
From: rave235 at gmail dot com
Operating system: winxp
PHP version: 5.2.1
PHP Bug Type: Scripting Engine problem
Bug description: nested foreach break -- infinite loop - serious
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 bug report at [url]http://bugs.php.net/?id=40768&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40768&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40768&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40768&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40768&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40768&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40768&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40768&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40768&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40768&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40768&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40768&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40768&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40768&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40768&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40768&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40768&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40768&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40768&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40768&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40768&r=mysqlcfg[/url]
rave235 at gmail dot com Guest
-
Mysql infinite loop?!
this query doesnt work: SELECT d.cID,d.cLName,d.cFName , k.kid FROM cname d, cu_key e, rep_key f , `key` k WHERE (d.cLName LIKE '%') and (((e.cID... -
Weird Infinite loop
Hello, I have this piece of code, and since i put it on a new webserver, it has caused an infinite loop. As you can see, n begins at 1, and B_x... -
#25037 [Opn->Asn]: SendText infinite loop
ID: 25037 Updated by: iliaa@php.net Reported By: richard at bradders2000 dot co dot uk -Status: Open +Status: ... -
#25037 [Opn]: SendText infinite loop
ID: 25037 User updated by: richard at bradders2000 dot co dot uk -Summary: SentText infinite loop Reported By: ... -
#25037 [NEW]: SentText infinite loop
From: richard at bradders2000 dot co dot uk Operating system: Windows Server 2003 PHP version: 4.3.3RC3 PHP Bug Type: Mail... -
abc at def dot ghi #2
#40768 [Opn]: nested foreach break -- infinite loop - serious
ID: 40768
User updated by: abc at def dot ghi
-Reported By: rave235 at gmail dot com
+Reported By: abc at def dot ghi
Status: Open
Bug Type: Scripting Engine problem
Operating System: winxp
PHP Version: 5.2.1
New Comment:
wonder if someone can check this on linux build if its win issue.
Previous Comments:
------------------------------------------------------------------------
[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 [url]http://bugs.php.net/?id=40768&edit=1[/url]
abc at def dot ghi Guest
-
abc at def dot ghi #3
#40768 [Opn->Csd]: nested foreach break -- infinite loop - serious
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 [url]http://bugs.php.net/?id=40768&edit=1[/url]
abc at def dot ghi Guest



Reply With Quote

