While writing a function to sanitize a configuration array, I noticed that it is not possible to call unset after &&
.Now I'm curious. What is the difference between unset and the call of any other function?
For example, the first short-if is completely valid the second one will throw a parser exception.
<?php
$a = ['test' => 1];
isset($a['test']) && test();
isset($a['test']) && unset($a['test']) ;
function test(){
return 123;
}