Reply to Re: $i = $i++

Your name:

Reply:


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, ++.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация