Depending the configuration of PHP, if we try to access an undefined variable, it could show an error.
$hello="world"; echo $hella; // <-- we show hella instead of hello
The system will show the next message:
Notice: Undefined variable: hella in php.php on line 3
We could disable it but it is not recommended (at least in our development ambiance). Why? Because typo happens.
One way to solve it, is to use the symbol at (@)
$hello="world"; echo @$hella;
It does the next job, if the variable is defined, then it shows the value. Otherwise, it will show a null.
But is it efficient?
$hello="world"; echo @$hella; //at echo isset($hella) ?? null; //issetnull7 >php 7.0 echo isset($hella) ? $hella : null; //issetnull5
Conclusion: @ is considerably slower. Also, there is little difference between ?? and the ternary operation.
why?. It is because @ is a special operation, it captures an error and it is a slow operation. Also, isset is a language construction (it's not a function), so isset is fastest.