I am trying to set a variable from a function, and then check if it is false in the same line. If it is false, I want to execute some code.
The code I have is the following:
if ($wordid = wordnet_get_wordid_from_word($word) == FALSE) {
db_set_active();
return $word;
}
However it appears that $wordid
is not getting set by this.
I've seen something like this being used before, and I've tested that inside the function, the value returned is NOT empty.
So what am I doing wrong here? Is it not possible to set a variable on the same line as you check whether it is false?