3 ms·
They're notices, not warnings. They can be disabled via a simple call to the error_reporting function. I fundamentally disagree with you though. For me, notice
by nbpoole 15y ago
They're notices, not warnings. They can be disabled via a simple call to the error_reporting function.
I fundamentally disagree with you though. For me, notices are very useful for identifying typos and other coding mistakes that can lead to incorrect behavior.
Consider the following lines of code:
$user_info = array(
'id' => 1,
'username' => 'nbpoole',
'is_guess' => false
);
if (!$user_info['is_guest'])
{
echo 'Member stuff';
}
When I run that script with error_reporting set to E_ALL, I get an "undefined index" notice pointing me to the line where I do the comparison: at that point, I can track down where in my code I misspelled the word guest. Without the notice, I might not immediately realize that the 'is_guest' index was mis-spelled somewhere.