If run right now, it will always produce the same value (4), but it isn't
*defined* to do so.  What that means is that behavior is subject to change
without notice, warning, or justification. This is a somewhat harsh way of
saying "Don't write expressions with ambiguous evaluations, that's clowny."

I would ask that you don't "fix" the docs, as we want to continue to
discourage users from engaging in unsafe behaviors.


On Fri, Jul 19, 2013 at 5:12 PM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:

> Hi all,
>
> Take a look at this bug report.
>
> https://bugs.php.net/bug.php?id=65087
>
> He complains about documentation of ++/--.
> The doc says
>
> http://www.php.net/manual/en/language.operators.precedence.php
> ---------------
> // mixing ++ and + produces undefined behavior
> $a = 1;
> echo ++$a + $a++; // may print 4 or 5
> ---------------
>
> "may print 4 or 5"?? Undefined??
> In old PHP there may be such limitation.
>
> I cannot believe this is true now, but I ask list before I fix doc.
>
> Any comments?
>
> --
> Yasuo Ohgaki
> yohg...@ohgaki.net
>

Reply via email to