Is there in PHP something similar to JavaScript\'s:
alert(test || \'Hello\');
So, when test is undefined or null we\'ll see Hello, otherwis
I'm very surprised this isn't suggested in the other answers:
echo isset($test) ? $test : 'hello';
From the docs isset($var) will return false if $var doesn't exist or is set to null.
The null coalesce operator from PHP 7 onwards, described by @Yamiko, is a syntax shortcut for the above.
In this case:
echo $test ?? 'hello';