I am currently in a process of writing my PHP script, and I am doing it with
E_ALL
set in php and I can not allow ANY errors, even
PHP Notice: Undefined variable
And I have many places where i ECHO
$myvariable
without checking if it's empty, which is causing error mentioned above.
Is it just me or it's extremely stupid to do this for every variable that can be undefined:
if(!empty($myvariable)) {
echo $myvariable;
}
Is this only way to avoid these errors?
EDIT: Question is not a duplicate, what you refereed to as duplicate has nothing to do with what i asked here.