Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76508 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46401 invoked from network); 14 Aug 2014 09:25:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2014 09:25:16 -0000 Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.46 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.192.46 mail-qg0-f46.google.com Received: from [209.85.192.46] ([209.85.192.46:61303] helo=mail-qg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/C0-40673-A708CE35 for ; Thu, 14 Aug 2014 05:25:15 -0400 Received: by mail-qg0-f46.google.com with SMTP id z60so785057qgd.33 for ; Thu, 14 Aug 2014 02:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=yWDTkZZDTdo1jkM9USoz5G/IeQMHgVaLDOdkVrbOyq0=; b=j1AJUiy2F31BFNHnoM5D9BgheziMV1Whrx7HkWSvEuykbAi0VEw8w2dQ49TvR9Ylka t977QYvnGX041lutN2Tkmn/qj84VX+y9Ry/6mNTzw5WZWTUTXZpTDCtjwu8F2UcL6wgT vxl8kHPc0AXOU5gZFyDrbc9iwoKtLmZniTmTRps41CE31bV3RbfQcp7FPdPGsufpBcUr THrkSz2ZCd0j11XDOgbO5LS92p79ebLmYCJf1LlccyUiLfdcL6rXdux7cBySLAlIRWcc P2cRHPVCZtF6ydgcJnL22OH4Tkt4tjITQS2Si7EcnvqZ36FJN3oFlzBIsIRVkO70HQPp K9+A== MIME-Version: 1.0 X-Received: by 10.140.83.17 with SMTP id i17mr1605650qgd.16.1408008311523; Thu, 14 Aug 2014 02:25:11 -0700 (PDT) Sender: are.you.winning@gmail.com Received: by 10.229.64.196 with HTTP; Thu, 14 Aug 2014 02:25:11 -0700 (PDT) In-Reply-To: References: <3F1B2834-3939-4F86-86E0-207D2CE469D6@ajf.me> Date: Thu, 14 Aug 2014 10:25:11 +0100 X-Google-Sender-Auth: QJ_sF0VQ_8u7nkuPIa34uvTjEMA Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Introduce Abstract Syntax Tree From: cw@daverandom.com (Chris Wright) On 13 August 2014 20:05, Nikita Popov wrote: > On Wed, Aug 13, 2014 at 7:18 PM, guilhermeblanco@gmail.com < > guilhermeblanco@gmail.com> wrote: > >> When is this planned to go through voting process? >> > > Before voting I'd like to have some opinions on the behavioral differences > the proposal introduces. In particular I'd like to know whether we are okay > with changing order of evaluation in some places. We document that > evaluation order is undefined, we document that it can change without > warning between versions and that it is inconsistent within one version. > However in the current implementation evaluation is usually left-to-right. > The AST implementation introduces some places where evaluation is > explicitly right-to-left, and not just incidentally. > > So basically the question is whether we are committed to things like > $a[$i++] = $i++ or $a[$i++][$i++] = $j being undefined behavior, in which > case order doesn't matter. If not, I can preserve left-to-right behavior > here (CVs notwithstanding of course), but it would come at the cost of a > good bit of additional complexity in the implementation (I suspect that I'd > have to reintroduce parts of the bp stack to properly shuffle the oplines > around). > > My personal opinion is that things like $a[$i++] = $i++ have zero practical > relevance (and also think that anyone using something like this deserves > any breakage he gets). I'd rather save some lines of code than maintain any > behavior guarantees for that. But some people have contrary opinions on > this, so I'm bringing up the point for discussion. +1. It's documented as undefined behaviour, doing it in the first place is highly non-obvious to the reader with a clear ambiguity, it's fine by me to break from the current behaviour. PHP is not and should not be designed around people who spend their days playing code golf and/or optimising away one opcode at a time.