note 32256 modified in function.error-reporting by didou

From: Date: Thu, 22 May 2003 13:37:33 +0000
Subject: note 32256 modified in function.error-reporting by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48823@lists.php.net to get a copy of this message
Try to avoid the use of E_USER_* errors when you can, as the script can better handle bad input better with conditional branching: # e.g. user entered "foo" $bad_data = "foo"; if ($input == $bad_data) { myErrorHandler("Gave bad data $input"); } else { processData($input); } Also, as a programming practice try to use E_NOTICE whenever possible to catch undefined variables. --was-- Try to avoid the use of E_USER_* errors when you can, as the script can better handle bad input better with conditional branching: # e.g. user entered "foo" $bad_data = "foo"; if ($input = $bad_data) { myErrorHandler("Gave bad data $input"); } else { processData($input); } Also, as a programming practice try to use E_NOTICE whenever possible to catch undefined variables. http://www.php.net/manual/en/function.error-reporting.php

« previous php.notes (#48823) next »