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] [EMAIL PROTECTED]

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

Reply via email to