|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-19 00:34 UTC] tony2001@php.net
[2005-12-19 00:47 UTC] sergiy dot sf at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 04:00:01 2025 UTC |
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 ...