Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23634 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36096 invoked by uid 1010); 24 May 2006 16:28:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36081 invoked from network); 24 May 2006 16:28:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2006 16:28:46 -0000 X-Host-Fingerprint: 80.123.98.46 unknown Received: from ([80.123.98.46:2205] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 69/27-19568-EB984744 for ; Wed, 24 May 2006 12:28:46 -0400 Message-ID: <69.27.19568.EB984744@pb1.pair.com> To: internals@lists.php.net Date: Wed, 24 May 2006 18:28:44 +0200 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <44748921.4010202@lorenso.com> In-Reply-To: <44748921.4010202@lorenso.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.123.98.46 Subject: Re: left/right order of assignment and ++ increment changed? 5.0.x -->5.1.x From: mike@php.net (Michael Wallner) 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< ---------- > $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