|
Posted by Gordon Burditt on 04/12/07 22:44
>I've never really understood why
>
> $i = $i++;
>
>_needs_ to be undefined in C, C++, or PHP.
It's difficult to find these things at compile time, or it would
have been defined as a fatal error at compile time. $i = $i++ is
a simple and obvious case of a much more complicated problem.
Preferably a standard would also demand deletion of all copies of
the source code the compiler could find.
>It seems that in order to assign
>the left side, one needs to evaluate the right side, and since ++ has to
>bind tighter than = ... it seems there should be an unequivocal "right"
>answer ... $i will be unchanged.
Which binds tighter, the increment of $i or returning the value of the
previous value? That's two separate operations represented by ONE
operator, ++.
Navigation:
[Reply to this message]
|