Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32240 invoked from network); 21 Aug 2014 07:16:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Aug 2014 07:16:59 -0000 Authentication-Results: pb1.pair.com header.from=dragoonis@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dragoonis@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: dragoonis@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qc0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:52091] helo=mail-qc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/90-27400-AEC95F35 for ; Thu, 21 Aug 2014 03:16:58 -0400 Received: by mail-qc0-f170.google.com with SMTP id x3so8878915qcv.1 for ; Thu, 21 Aug 2014 00:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WiQMIXknC2J32VdHkPfJYmvDbNftMYldXdCZjW/tcXs=; b=mVX5u3GDCbjoi6q1+IXMxcauibRYNvfYMsZ3T89ll2Gu82GRa/MBgkPZrpq8xvh1Xb z90KFDf9YEVkfw71wwAAScgu6k0lxgA0hVld6Mn83/7O+3jrWbaReTYQguf05EFtaend 9hzmhxePAsaZqzQH8W13W86DvnwLe3IKfhP0nYcH8DZHQg/gfYv8tLpbIekxJi1g4MyW OPVxM+tlNrLA2kLbhxoBfwwOPkZmp79b6Ig587JChTZKGgHk2Deaq8YIQY+3auCWF5wX ACoVGfN7wWj2KowaUg/CZ0RnMEkKvEttXSwGLKJMa8KRXefrI2OTcc8k6hy3PhGCpFJq O+SA== MIME-Version: 1.0 X-Received: by 10.140.18.211 with SMTP id 77mr80237365qgf.57.1408605415989; Thu, 21 Aug 2014 00:16:55 -0700 (PDT) Received: by 10.229.97.71 with HTTP; Thu, 21 Aug 2014 00:16:55 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Aug 2014 08:16:55 +0100 Message-ID: To: Levi Morrison Cc: Andi Gutmans , Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=001a11353dd072ea6105011e81fa Subject: Re: [PHP-DEV] [VOTE] Abstract Syntax Tree From: dragoonis@gmail.com (Paul Dragoonis) --001a11353dd072ea6105011e81fa Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Aug 20, 2014 at 3:41 PM, Levi Morrison wrote: > On Wed, Aug 20, 2014 at 7:30 AM, Paul Dragoonis > wrote: > > On Tue, Aug 19, 2014 at 3:32 AM, Andi Gutmans wrote: > > > >> Hi Nikita, > >> > >> I reviewed the AST RFC on my way to vote but there was something that > >> wasn=E2=80=99t clear to me. > >> This patch introduces some semantic/behavioral changes in addition to > the > >> AST. > >> Are these as a side-effect of how AST was implemented? Or are they > >> unrelated to the AST patch? > >> I think some of them make sense but I=E2=80=99m having a bit of a hard= time > >> separating out the benefits of the AST (which I really like) and makin= g > >> other changes to semantics w/o really understanding if they are > >> side-effects and we have no choice vs. we=E2=80=99re trying to solve f= or two > >> separate items in one RFC. > >> Any BC breaks here we think could bite us? > >> > > > > Hi Nikita, > > > > I second some of Andi's concerns about behavioural changes, some things > > working from right-to-left and not left-to-right. Are these things that > we > > can adapt the AST part or tweak another part to make this more consiste= nt > > with previous versions of PHP. > > I just had a chat with Paul about this, and there was a > misunderstanding about what this RFC actually does regarding > left-to-right evaluation on list() constructs. I also saw this > misunderstanding in a few other places, so it seems to be a common > misunderstanding. > > Under the proposed changes as well as in PHP 5.x, the end result of > the following is the same: > > list($a, $b) =3D array(1, 2); > > $a will be 1 and $b will be 2. Again, this hasn't changed. The > difference is that in PHP 5.x the variable $b will be assigned 2 > before $a is assigned 1; under these changes $a will be assigned 1 > first and then $b will be assigned 2. > I'm happy with this behaviour and agree that the AST version is what I would expect, my confusion was that I thought PHP 5.x was 1,2 and the AST was 2,1 which it of course is not the case. Now you could see why I raised concerns about this in the first place. > > This really only affects strange situations, such as ones listed in the > RFC. > --001a11353dd072ea6105011e81fa--