Re: Operator precedence is undefined?

From: Date: Sat, 20 Jul 2013 04:27:34 +0000
Subject: Re: Operator precedence is undefined?
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Fri, Jul 19, 2013 at 11:56 PM, Sara Golemon <[email protected]> wrote:

> On Fri, Jul 19, 2013 at 7:16 PM, Yasuo Ohgaki <[email protected]> wrote:
>
>>
>>
>> If there aren't comments, I'll rewrite the example.
>>
>>
>> There were comments.  I explicitly told you that that the behavior is
> defined as undefined.  You CHOSE to ignore that comment.  You CHOSE to
> break the documentation.
>

With all due respect, how is the behavior undefined? Our parser defines the
precedence of those operators being higher in the precedence table than the
ones mentioned. The post inc/dec operators are also well-defined in
returning their values "Returns $a, then increments $a by one." at
www.php.net/language.operators.increment

I present the source as well
http://lxr.php.net/xref/PHP_5_5/Zend/zend_compile.c#1196

I'm confused about why you believe this is undefined behavior? Perhaps you
can elaborate on why this should be left in the documentation as undefined
despite what I believe to be clear evidence of definition. I don't see
"discouraged behavior" and "undefined behavior" to be synonymous. I do feel
it's OK to place notes/warnings in the manual about discouraged behavior,
however, just as we do with nesting ternary operators.


Thread (30 messages)

« previous php.internals (#68247) next »