Re: Whacky increment/assignment logic with $foo++ vs ++$foo

From: Date: Sat, 03 Oct 2009 14:42:04 +0000
Subject: Re: Whacky increment/assignment logic with $foo++ vs ++$foo
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-298522@lists.php.net to get a copy of this message
At 2:01 PM -0700 10/2/09, Daevid Vincent wrote:
Why would you EVER want $num = $num++; to give you back the value you already had? Even if we did $foo = $bar++; I would still logically (and common sensely) expect $foo to be the increment of $bar!
You are right -- one should never structure a statement like that. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#298522) next »