Re: Re: left/right order of assignment and ++ increment changed? 5.0.x -->5.1.x
| From: | D. Dante Lorenso | Date: | Thu, 25 May 2006 06:48:47 +0000 |
| Subject: | Re: Re: left/right order of assignment and ++ increment changed? 5.0.x -->5.1.x | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23642@lists.php.net to get a copy of this message | ||
Sara Golemon wrote:
No complaints here. This is a change I can easily work around and don't mind the BC breakage. Just wanted to illuminate the error to internals just in case it would reflect upon possible breakage elsewhere. I worked around the undefined behavior before the first email was sent ;-) Keep up the good work all. DanteSeems the order or left vs right assignment evaluation has changed somehow recently in my upgrade to PHP 5.1.4. See the following code:That's is indeed a quirk of a change in the way variables are retreived/stored between 5.0 and 5.1. Is it an unexpected BC break? In functional terms yes, but technically no. As mike already replied, using the same var more than once in a single expression where the value of the variable is expected to change is (and has always been) considered "undefined behavior". I'd recommend changing your statement to: $data[$index] = $index; ++$index; And before you complain about the "extra work" for the engine, let me just mention this is still lighter weight than what 5.0 and 4.x were doing.