#35729 [Opn->Bgs]: infinite loop in php-4.4.1

From: Date: Sun, 18 Dec 2005 23:34:49 +0000
Subject: #35729 [Opn->Bgs]: infinite loop in php-4.4.1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-90625@lists.php.net to get a copy of this message
ID: 35729 Updated by: tony2001@php.net Reported By: sergiy dot sf at gmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: FreeBSD 5.4-RELEASE PHP Version: 4.4.1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#90625) next »