left/right order of assignment and ++ increment changed? 5.0.x --> 5.1.x

From: Date: Wed, 24 May 2006 16:26:09 +0000
Subject: left/right order of assignment and ++ increment changed? 5.0.x --> 5.1.x
Groups: php.internals 
Request: Send a blank email to internals+get-23633@lists.php.net to get a copy of this message
Internals, Seems the order or left vs right assignment evaluation has changed somehow recently in my upgrade to PHP 5.1.4. See the following code: ---------- 8< -------------------- 8< ---------- <?php $data = array(); $index = 0; for ($x = 0; $x < 5; $x++) { $data[$index] = $index++; } print_r($data); ?> ---------- 8< -------------------- 8< ---------- in PHP 5.0.5: Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 ) in PHP 5.1.4: Array ( [1] => 0 [2] => 1 [3] => 2 [4] => 3 [5] => 4 ) Is this a bug, a feature, or bad programmer [me]? Dante

« previous php.internals (#23633) next »