Re: Operator precedence is undefined?
(Piggy-backing on Sara's e-mail, although this is more a response to
Sherif and Yasuo.)
On 19 July 2013 22:33, Sara Golemon <[email protected]> wrote:
> I never said that the compiler might magically produce differing results
> for the same input. I said that the language's definition does not declare
> a defined behavior for such expressions with combined side effects.
This is also a classic piece of undefined behaviour in most C-like
languages — Bjarne Stroustrup lists it in his C++ FAQ, for instance:
http://www.stroustrup.com/bs_faq2.html#evaluation-order.
That's not to
say that PHP necessarily has to be the same as other languages in its
"family" (nested ternaries, anyone?), but I don't think that PHP is
really doing anything different here that would make it well defined:
AFAIK, the only places PHP makes guarantees about the order of
evaluation with regard to binary operators is short circuiting the
boolean operators.
> As to reverting commits. When the initial commit was made in haste during
> an active discussion, a revert is entirely appropriate and has nothing to
> do with placing one's opinion over another's. It has to do with placing
> the process of consensus building over unilateral cowboy commits.
+1.
Adam
Thread (30 messages)