I love doing this sort of thing in Perl: $foo = $bar || $baz to assign $baz to $foo if $bar is empty or undefined. You al
$foo = $bar || $baz
$baz
$foo
$bar
In PHP earlier than 7.*, one may use ?: for an undefined variable having errors locally suppressed with an @:
@
$foo = @$bar ?: $baz;