ID: 35709
User updated by: ait-ali dot mohamed at laposte dot net
Reported By: ait-ali dot mohamed at laposte dot net
Status: Bogus
Bug Type: Arrays related
Operating System: WIN 2K
PHP Version: 5.1.1
New Comment:
But this code works in previous versions (5.0.0, 4.3.9, 4.3.8), without
change anything in optimization.
Previous Comments:
------------------------------------------------------------------------
[2005-12-16 15:21:32] [EMAIL PROTECTED]
The behaviour of such code is undefined in all languages I know of and
may vary depending on the optimization level used.
------------------------------------------------------------------------
[2005-12-16 15:15:11] ait-ali dot mohamed at laposte dot net
Description:
------------
It seems to be an bas assignation for the array.
The engine begins to increment the variable, before
assign in the array's key.
Reproduce code:
---------------
<?
$table = array();
$i = 0;
$table [$i][0] = $i++;
print_r($table);
?>
Expected result:
----------------
Array
(
[0] => Array
(
[0] => 0
)
)
Actual result:
--------------
Array
(
[1] => Array
(
[0] => 0
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35709&edit=1