Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23635 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84864 invoked by uid 1010); 24 May 2006 17:50:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 84849 invoked from network); 24 May 2006 17:50:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2006 17:50:37 -0000 X-PHP-List-Original-Sender: pollita@php.net X-Host-Fingerprint: 69.12.155.130 69-12-155-130.dsl.static.sonic.net Linux 2.4/2.6 Received: from ([69.12.155.130:2858] helo=pigeon.alphaweb.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 67/1E-19568-DEC94744 for ; Wed, 24 May 2006 13:50:37 -0400 Received: from localhost ([127.0.0.1] helo=OHRLVN4523SG) by pigeon.alphaweb.net with smtp (Exim 4.10) id 1Fiwqm-0003mw-00; Wed, 24 May 2006 10:08:48 -0700 Message-ID: <000a01c67f5a$88f687c0$41311a44@OHRLVN4523SG> To: Cc: References: <44748921.4010202@lorenso.com> Date: Wed, 24 May 2006 10:49:43 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 Subject: Re: left/right order of assignment and ++ increment changed? 5.0.x -->5.1.x From: pollita@php.net ("Sara Golemon") > 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. -Sara