View Single Post
  #14  
Old 06-22-2006, 07:34 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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;
} 
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote