ID: 35709 Updated by: [EMAIL PROTECTED] Reported By: ait-ali dot mohamed at laposte dot net -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: WIN 2K PHP Version: 5.1.1 New Comment:
The behaviour of such code is undefined in all languages I know of and may vary depending on the optimization level used. Previous Comments: ------------------------------------------------------------------------ [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