Quote:
Originally Posted by Skyld
So if you want it to return the value of the variable that you are assigning to, why did you not just say so?
|
It has practical applications mainly with functions that return false on error. Instead of having to have two separate lines you can do it all in one.
ie:
PHP Code:
// ..
if(!(temp.blah = Foo(this.bar))) {
echo("ZOMG ERROR");
}
// ..
function Foo(bar) {
if(bar < 10) return false;
else return bar % 10;
}