ID: 42152 Updated by: [EMAIL PROTECTED] Reported By: php at tfwasmus dot enschedenet dot nl -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Windows Xp x64 PHP Version: 5CVS-2007-07-30 (snap) New Comment:
Either I missed something but = has lower precedence than [ ? Previous Comments: ------------------------------------------------------------------------ [2007-07-30 23:26:44] php at tfwasmus dot enschedenet dot nl Description: ------------ According to the operator precedence (http://www.php.net/manual/en/language.operators.php#language.operators.precedence), a (post)increment should be evalued after the '['. It seems that isn't true in assigning to an array in PHP5 anymore, while it was in PHP4. Latest snapshots of both checked (30-07-2007). This could also be a documentation problem. Reproduce code: --------------- <?php $k = 1; $a = array(); $a[$k] = $k++; var_dump($a,$k); ?> Expected result: ---------------- array(1) { [1]=> int(1) } int(2) Actual result: -------------- array(1) { [2]=> int(1) } int(2) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42152&edit=1