php error_reporting() 设置错误报告级别
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Libérer: 2016-07-25 08:51:23
original
1051 Les gens l'ont consulté
-
- * 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);
复制代码
常见的如下:
-
-
// Turn off all error reporting;关闭所有的错误
- error_reporting(0);
// Report simple 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 …);包括报告一些未初始化的变量或捕捉变量名的拼写错误
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;报告所有的错误但不包括E_NOTICE
error_reporting(E_ALL ^ E_NOTICE);
- // Report all PHP errors (bitwise 63 may be used in PHP 3);报告所有的错误
error_reporting(E_ALL);
- // Same as error_reporting(E_ALL);同上
- ini_set(’error_reporting’, E_ALL);
-
复制代码
|
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Derniers articles par auteur
-
2025-02-26 03:58:14
-
2025-02-26 03:38:10
-
2025-02-26 03:17:10
-
2025-02-26 02:49:09
-
2025-02-26 01:08:13
-
2025-02-26 00:46:10
-
2025-02-25 23:42:08
-
2025-02-25 22:50:13
-
2025-02-25 21:54:11
-
2025-02-25 20:45:11