#35729 [Bgs]: infinite loop in php-4.4.1
| From: | sergiy dot sf at gmail dot com | Date: | Sun, 18 Dec 2005 23:47:25 +0000 |
| Subject: | #35729 [Bgs]: infinite loop in php-4.4.1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-90627@lists.php.net to get a copy of this message | ||
ID: 35729
User updated by: sergiy dot sf at gmail dot com
Reported By: sergiy dot sf at gmail dot com
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: FreeBSD 5.4-RELEASE
PHP Version: 4.4.1
New Comment:
sorry to trouble you
Previous Comments:
------------------------------------------------------------------------
[2005-12-19 00:34:48] tony2001@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
We had about 10 reports about it before.
------------------------------------------------------------------------
[2005-12-19 00:28:19] sergiy dot sf at gmail dot com
Description:
------------
PHP 4.4.1 drops into an infinite loop
(lots of '1 => one' gets printed). This
problem doesn't exist in PHP 5.1.1 and
in PHP version prior 4.4.1.
Reproduce code:
---------------
<?php
$a =
array('1'=>'one','2'=>'two','3'=>'three');
function test(){
global $a;
for( reset($a); $key = key($a); next($a)) {
echo "$key => $a[$key]\n";
}
}
test();
?>
Expected result:
----------------
1 => one
2 => two
3 => three
Actual result:
--------------
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
1 => one
...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35729&edit=1