perador de fusión nula de @ C # (??) en PHP
¿Hay un operador ternario o similar en PHP que actúa como??
De c#
??
en C # es limpio y más corto, pero en PHP debe hacer algo como:
// This is absolutely okay except that $_REQUEST['test'] is kind of redundant.
echo isset($_REQUEST['test'])? $_REQUEST['test'] : 'hi';
// This is perfect! Shorter and cleaner, but only in this situation.
echo null? : 'replacement if empty';
// This line gives error when $_REQUEST['test'] is NOT set.
echo $_REQUEST['test']?: 'hi';