These are small and not serious errors, such as accessing an undefined variable. Generally, these errors are not prompted to the user, but sometimes these errors affect the running result. 1. Note (Notices)
These are small and not serious errors, such as accessing an undefined variable. Generally, these errors are not prompted to the user, but sometimes these errors affect the running result.
2. warning (Warnings)
This is a slightly serious error. for example, you want to include () A file that does not exist. This error message will prompt the user, but will not cause the program to stop running.
3. Fatal errors)
These are serious errors. for example, if you want to initialize a non-existent class object or call a non-existent function, these errors will cause the program to stop running, PHP will also display these errors to users.
Different error types include:
E_ERROR: it is usually displayed and the program execution is interrupted.
E_WARNING: usually displayed, but the execution of the program will not be interrupted.
E_NOTICE: code error that occurs when the script runs normally.
E_PARSE: syntax parsing error.
E_CORE_ERROR: a fatal error that occurs when PHP is started.
E_CORE_WARNING: reports non-fatal errors that occur when PHP is started.
E_COMPILE_ERROR: Fatal error during compilation, indicating a script error.
E_USER_ERROR: Error message generated by the user.
E_USER_WARNING: user-generated warning information.
E_USER_NOTICE: User-triggered attention message.
E_STRICT: indicates the code standardization warning. an error occurs during running.
E_RECOVERABLE_ERROR: near a fatal runtime error. if it is not captured, it is treated as E_ERROR.
E_ALL: capture all errors and warnings.
The methods for blocking PHP error messages are as follows:
Method 1: Add @ before a function with a possible error, and then or die ("")
For example:
@ Mysql_connect (...) or die ("Database Connect Error ")
Method 2: edit php. ini, find "display_errors =", and change the value after "=" to "off.
Method 3: Add error_reporting (0) to the php script to block all error messages.
Here, error_reporting configures the error information return level.
Syntax: int error_reporting (int [level]);
Return value: integer
Function types: PHP system functions