Re: [RFC] Introduce Abstract Syntax Tree

From: Date: Thu, 14 Aug 2014 10:35:53 +0000
Subject: Re: [RFC] Introduce Abstract Syntax Tree
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-76513@lists.php.net to get a copy of this message
On 14 08 2014, at 11:33, Alain Williams <addw@phcomp.co.uk> wrote: > On Thu, Aug 14, 2014 at 10:25:11AM +0100, Chris Wright wrote: > >>> 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. > > +1 > > It is OK to define some things as undefined and have them break between releases - > even minor releases. I always teach it as undefined - as it is in most > programming languages. > > Likewise, if the next 2 characters on input are 'a' then 'b' what gets > assigned > could either be 'ab' or 'ba': > > $TwoChars = fgetc($in) . fgetc($in); > > Some code is just broken. Wat? No. This is totally different to two in/decrements on one line. This has to be executed in order. Cheers, Mike

« previous php.internals (#76513) next »