Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23642 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89096 invoked by uid 1010); 25 May 2006 06:48:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 89081 invoked from network); 25 May 2006 06:48:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2006 06:48:56 -0000 X-PHP-List-Original-Sender: dante@vocalspace.com X-Host-Fingerprint: 69.56.193.72 fox02.stravio.com Linux 2.5 (sometimes 2.4) (4) Received: from ([69.56.193.72:35942] helo=fox02.stravio.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 37/1D-17316-75355744 for ; Thu, 25 May 2006 02:48:55 -0400 Received: from [127.0.0.1] (c-67-163-105-145.hsd1.tx.comcast.net [67.163.105.145]) by fox02.stravio.com (Postfix) with ESMTP id 43E9B26C2C2; Thu, 25 May 2006 01:48:52 -0500 (CDT) Message-ID: <4475534F.8020202@vocalspace.com> Date: Thu, 25 May 2006 01:48:47 -0500 User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: Sara Golemon Cc: dante@lorenso.com, internals@lists.php.net References: <44748921.4010202@lorenso.com> <000a01c67f5a$88f687c0$41311a44@OHRLVN4523SG> In-Reply-To: <000a01c67f5a$88f687c0$41311a44@OHRLVN4523SG> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: left/right order of assignment and ++ increment changed? 5.0.x -->5.1.x From: dante@vocalspace.com ("D. Dante Lorenso") Sara Golemon wrote: >> 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: >> > 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. 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. Dante