From: kyrmich at badfan dot coim
Operating system: WIN XP / SP2
PHP version: 4.4.1
PHP Bug Type: Arrays related
Bug description: reset/next is broken
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 bug report at http://bugs.php.net/?id=35374&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35374&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35374&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35374&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35374&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35374&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35374&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35374&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35374&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35374&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35374&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35374&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35374&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35374&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35374&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35374&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35374&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35374&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35374&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35374&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35374&r=mysqlcfg