ID: 44953
User updated by: ies_clan at hotmail dot com
Reported By: ies_clan at hotmail dot com
Status: Open
Bug Type: Variables related
Operating System: Linux
PHP Version: 5.2.6
New Comment:
oh sry i interchanges the field...
Expected result:
----------------
0
1
2
Actual result:
--------------
1
2
Previous Comments:
------------------------------------------------------------------------
[2008-05-09 09:58:03] ies_clan at hotmail dot com
Description:
------------
If you try to use Variable variables in a foreach, the output of the
array is wrong
Reproduce code:
---------------
$array = Array(
0 => Array('11', '12', '13'),
1 => Array('21', '22', '23'),
2 => Array('31', '32', '33')
);
$key = 'key';
$value = 'value';
foreach($array AS ${$key} => ${$value}){
echo ${$key}." -\n";
}
Expected result:
----------------
1
2
Actual result:
--------------
0
1
2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44953&edit=1