On 13 August 2014 20:05, Nikita Popov <nikita....@gmail.com> wrote:
> On Wed, Aug 13, 2014 at 7:18 PM, guilhermebla...@gmail.com <
> guilhermebla...@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.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to