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

From: Date: Wed, 24 May 2006 16:28:44 +0000
Subject: Re: left/right order of assignment and ++ increment changed? 5.0.x -->5.1.x
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-23634@lists.php.net to get a copy of this message
D. Dante Lorenso wrote:
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++; }
The behaviour is undefined (tm) if you use the variable to be in/decremented more than once in a statement. Regards, -- Michael

« previous php.internals (#23634) next »