($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.
Re^5: Is Perl a good career move?
Replies are listed 'Best First'.