-
- * For now, avoid warnings of E_STRICT mode
- * (this must be done before function definitions)
- */
- if (defined('E_STRICT')) {
- $old_error_reporting = error_reporting(0);
- if ($old_error_reporting & E_STRICT) {
- error_reporting($old_error_reporting ^ E_STRICT);
- } else {
- error_reporting($old_error_reporting);
- }
- unset($old_error_reporting);
Copy code
Common ones are as follows:
-
-
// Turn off all error reporting; Turn off all errors
- error_reporting(0);
// Report simple running errors; Report a simple running errors Running errors
- error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Reporting E_NOTICE can be good too (to report uninitialized
- // variables or catch variable name misspellings …); including reporting some uninitialized
- // variables or catch variable name misspellings …); Initialized variables or catching typos in variable names
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
- // Report all errors except E_NOTICE
- // This is the default value set in php .ini;Report all errors but not E_NOTICE
error_reporting(E_ALL ^ E_NOTICE);
- // Report all PHP errors (bitwise 63 may be used in PHP 3);Report all errors< ;/p>
error_reporting(E_ALL);
- // Same as error_reporting(E_ALL); Same as above
- ini_set('error_reporting', E_ALL);
Copy code
|