From: jlim at natsoft dot com
Operating system: Windows XP
PHP version: 5.0.0b1 (beta1)
PHP Bug Type: Scripting Engine problem
Bug description: foreach ($k=>$v), the key $k is missing
Description:
------------
The following script below fails (missing $k).
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
echo PHP_VERSION."<br>";
print_r($_GET);
foreach($_GET as $k=>$v) {
global $$k;
print " ($k=>$v) ";
$$k = $v;
}
?>
Expected result:
----------------
5.0.0b1
Array ( [a] => 1 [b] => 2 [c] => 3 ) (a=>1) (b=>2) (c=>3)
Actual result:
--------------
5.0.0b1
Array ( [a] => 1 [b] => 2 [c] => 3 ) (=>1) (=>2) (=>3)
--
Edit bug report at http://bugs.php.net/?id=24396&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24396&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24396&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24396&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24396&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24396&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24396&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24396&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24396&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24396&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24396&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24396&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24396&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24396&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24396&r=gnused