php error_reporting() 设置错误报告级别
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Lepaskan: 2016-07-25 08:51:23
asal
1051 orang telah melayarinya
-
- * 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);
-
复制代码
|
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel terbaru oleh pengarang
-
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
Topik-topik yang berkaitan
Lagi>