Loading... # PHP Error Levels There are sixteen different error levels (i.e. types) are available in PHP. ## Error Levels in PHP Usually, whenever the PHP engine encounters a problem that prevents a script from running properly it generate an error message. There are sixteen different error levels and each level is represented by an integer value and an associated constant. Here’s a list of error levels: | Error Level | Value | Description | | --------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | E\_ERROR | 1 | A fatal run-time error, that can’t be recovered from. The execution of the script is stopped immediately. | | E\_WARNING | 2 | A run-time warning. It is non-fatal and most errors tend to fall into this category. The execution of the script is not stopped. | | E\_PARSE | 4 | The compile-time parse error. Parse errors should only be generated by the parser. | | E\_NOTICE | 8 | A run-time notice indicating that the script encountered something that could possibly an error, although the situation could also occur when running a script normally. | | E\_CORE\_ERROR | 16 | A fatal error that occur during the PHP’s engine initial startup. This is like an E\_ERROR, except it is generated by the core of PHP. | | E\_CORE\_WARNING | 32 | A non-fatal error that occur during the PHP’s engine initial startup. This is like an E\_WARNING, except it is generated by the core of PHP. | | E\_COMPILE\_ERROR | 64 | A fatal error that occur while the script was being compiled. This is like an E\_ERROR, except it is generated by the Zend Scripting Engine. | | E\_COMPILE\_WARNING | 128 | A non-fatal error occur while the script was being compiled. This is like an E\_WARNING, except it is generated by the Zend Scripting Engine. | | E\_USER\_ERROR | 256 | A fatal user-generated error message. This is like an E\_ERROR, except it is generated by the PHP code using the function trigger\_error() rather than the PHP engine. | | E\_USER\_WARNING | 512 | A non-fatal user-generated warning message. This is like an E\_WARNING, except it is generated by the PHP code using the function trigger\_error() rather than the PHP engine | | E\_USER\_NOTICE | 1024 | A user-generated notice message. This is like an E\_NOTICE, except it is generated by the PHP code using the function trigger\_error() rather than the PHP engine. | | E\_STRICT | 2048 | Not strictly an error, but triggered whenever PHP encounters code that could lead to problems or forward incompatibilities | | E\_RECOVERABLE\_ERROR | 4096 | A catchable fatal error. Although the error was fatal, it did not leave the PHP engine in an unstable state. If the error is not caught by a user defined error handler (see set\_error\_handler()), the application aborts as it was an E\_ERROR. | | E\_DEPRECATED | 8192 | A run-time notice indicating that the code will not work in future versions of PHP | | E\_USER\_DEPRECATED | 16384 | A user-generated warning message. This is like an E\_DEPRECATED, except it is generated by the PHP code using the function trigger\_error() rather than the PHP engine. | | E\_ALL | 32767 | All errors and warnings, except of level E\_STRICT prior to PHP 5.4.0. | Last modification:September 15, 2024 © Allow specification reprint Like 如果觉得我的文章对你有用,请随意赞赏