Home >Backend Development >PHP Tutorial >PHP exception level analysis
This article mainly shares with you the PHP exception level analysis, hoping to help everyone.
Deprecated The lowest level error (not recommended, not recommended)
It will appear when using some expired functions, and the program will continue to execute
Notice Notice Level error
Will appear when using some undefined variables, constants or array keys without quotation marks, the program continues to execute
Waning Warning level error
There is a problem with the program, need Modify the code! ! ! The program continues to execute
Fatal Error Error level error
The program reports an error directly and the code needs to be modified! ! ! To interrupt the execution of the program, you can use the register_shutdown_function() function to trigger a function before the program terminates
Parse error Grammar parsing error
An error is reported during the syntax check phase, and the code needs to be modified! ! ! Interrupting program execution, nothing can be done except modifying the ini file and writing error information to the log
E_USER_Related errors
User-defined errors, the user manually throws errors, proceed Custom error handling
PHP exception and error throwing
Exception throw: throw new Exception('Some Error Message');
Error throw: trigger_error()## Errors triggered by #trigger_error() will not be caught by try-catch exception catching statements.
The above is the detailed content of PHP exception level analysis. For more information, please follow other related articles on the PHP Chinese website!