Reply to Re: $i = $i++

Your name:

Reply:


Posted by Gordon Burditt on 04/11/07 22:42

>Yes, definately a syntax to avoid, seems unpredictable at best...
>
><?php
> $i = 2;
> echo $i++ + 1; /// i'd expect 4, gives 3, ignores ++ increment

Please get your expecter fixed. $i++ returns the value *BEFORE*
the increment. (If you want ++$i, you know where to find it.) This
one is unambiguous since all possible orders come up with the same
result.

For the other expressions involving $i++ and another reference to $i's
value to give a resource returning Donald Trump, who's going to find the
programmer and say "You're Fired".

[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

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