#35374 [Opn->Bgs]: reset/next is broken

From: Date: Thu, 24 Nov 2005 21:33:04 +0000
Subject: #35374 [Opn->Bgs]: reset/next is broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88877@lists.php.net to get a copy of this message
ID: 35374 Updated by: tony2001@php.net Reported By: kyrmich at badfan dot coim -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: WIN XP / SP2 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. Fixed in CVS several weeks ago. Previous Comments: ------------------------------------------------------------------------ [2005-11-24 22:31:28] kyrmich at badfan dot coim Description: ------------ Broken reset/next functionality after upgrading from PHP 4.4.0 to 4.4.1 when the array is passed from the global scope. The code below results in an infinite loop Reproduce code: --------------- <? $Buffer["key1"] = "value1"; Process(); function Process() { global $Buffer; for (reset($Buffer); $key=key($Buffer); next($Buffer)) { print "processing key: $key\n"; } print "done\n"; } ?> Expected result: ---------------- processing key: key1 done Actual result: -------------- processing key: key1 . . infinite loop . processing key: key1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35374&edit=1

« previous php.bugs (#88877) next »