At 2:53 PM -0700 10/2/09, Ben Dunlap wrote:
$a = 2;
$a = $a++;
echo $a;
Honestly I think the only reason anyone would write an expression like
that is either to fake out the compiler or because they don't properly
understand the use of a unary operator. Or rather, of the
increment/decrement operators, because no other unary operator
actually changes the thing it operates on (AFAIK), which makes ++ and
-- doubly weird.
Ben
Honestly, I think that the only reason why one would write that is
that they don't know any better.
Why do this:
$a = $a++;
when
$a++;
will do what is intended?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php