RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo
| From: | Andrea Giammarchi | Date: | Tue, 06 Oct 2009 13:00:01 +0000 |
| Subject: | RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298645@lists.php.net to get a copy of this message | ||
> It will be an accident
> if you get the results you are expecting.
I agree that the operation is illogical, I must disagree about accidents.
In PHP that operation will mean assign to the new $a variable the value returned from the other $a
variable before the increment.
There is no mystery here, imho.
Regards
_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010