error_reporting()
## is used to set the PHP error reporting level and return the current level. (PHP 4, PHP 5) (Recommended learning:
PHP Video Tutorial) The
function can set the error_reporting directive at runtime.PHP has many error levels. Use this function to set the level when the script is running.
If the optional parameter level is not set, error_reporting() will only return the current error reporting level.Deprecated 最低级别错误,程序继续执行 Notice 通知级别的错误 如直接使用未声明变量,程序继续执行 Warning 警告级别的错误,可能得不到想要的结果 Fatal error 致命级别错误致命级别错误,程序不往下执行 parse error 语法解析错误,最高级别错误,连其他错误信息也不呈现出来 E_USER_相关错误 用户设置的相关错误
Example:
error_reporting(E_ALL&~E_NOTICE)不显示通知级别的错误。“~”表示非。
The above is the detailed content of What are the php error levels?. For more information, please follow other related articles on the PHP Chinese website!