RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

From: Date: Tue, 06 Oct 2009 12:51:17 +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-298644@lists.php.net to get a copy of this message
From: Joost [mailto:joost.t.hart@planet.nl] > "Daevid Vincent" wrote: >>> From: Ben Dunlap [mailto:bdunlap@agentintellect.com] > $a = $a++; I just think this is an ambiguous line of code that wasn't thought through. The presence of the postfix operator makes the result undefined, no matter what language you are using. It will be an accident if you get the results you are expecting. Bob McConnell

« previous php.general (#298644) next »