PHP Notice - ignore or stop from happening?
When a variable is not set and is checked for matching data, such as
if($variable == "text"), a PHP notice (undefined variable) is returned.
I have a security check where it is possible and fine that a var might not be set, but the point of the check is to only perform an action if the var is set to something specific.
As such, I don't bother with additional PHP code such as
Usually the PHP error settings are a little less strict and don't return these in the error logs.
But if PHP notices are set to be logged in a file, is the opening, appending and closing of a file more resource than a bit of PHP code checking if the var is set?
What about when PHP is set to not log these errors? Do we just allow it to silently ignore the issue?
What are your thoughts and general practice with this?