The code is short,but complete:
function process($obj)
{
if(empty($obj))return 1;
return 2;
}
echo process($arr['nosuchkey']);
As we all know, calling empty($arr['nosuchkey'])
will never report warnings.
But process($arr['nosuchkey'])
will report a notice.
Is there a workaround without disabling warnings; say, by syntax?