On 14 08 2014, at 11:33, Alain Williams <a...@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


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

Reply via email to