Is there in PHP something similar to JavaScript\'s:
alert(test || \'Hello\');
So, when test is undefined or null we\'ll see Hello, otherwis
From PHP 7 onwards you can use something called a coalesce operator which does exactly what you want without the E_NOTICE that ?: triggers.
?:
To use it you use ?? which will check if the value on the left is set and not null.
??
$arr = array($one ?? 'one?', $two ?? 'two?');