Michael Wallner wrote:

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

The current specification draft says[1]:

| Unless stated explicitly in this specification, the order in which
| the operands in an expression are evaluated relative to each other is
| unspecified.
| [...]
| Finally, in the full expression f() + g() * h(), the order in which
| the three functions are called, is unspecified).

[1]
<https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#expressions>

-- 
Christoph M. Becker

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

Reply via email to