Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^5: Is Perl a good career move?by Anonymous Monk |
on Jan 02, 2008 at 20:05 UTC ( [id://660049]=note: print w/replies, xml ) | Need Help?? |
($foo = bar()) || ($foo = $baz);
$foo = (($bar = bar()) ? $bar : $baz);
The key is that the || casts the right hand side as a boolean, and php does not have a magic variable that gets set while you aren't looking.
In Section
Meditations
|
|