Php error level, php error level
In the php programming process, you will surely encounter more or less error reminders. These error prompts guide us to write cleaner code. Today, we will first write the error types we listed, first, you need to dig a hole to learn about php errors and exceptions.
Deprecated: minimum error. The program continues to execute.
If a Notice notification-level error is reported directly using an undeclared variable, the program continues to execute
The expected result may not be returned due to an error at the Warning level.
Fatal error: Fatal error. The program is not executed.
Parse error Syntax Parsing error. The maximum error level does not display any other error information.
E_USER _ related errors related to user settings
Use the trigger_error () function to set a user-level error/warning/notice information.
How do I set the error level?
Error_reporting (-1)Show all errors,Error_reporting (0)Block all errors. Ini_set ('error _ report', 0) also shields all errors. You can set error_reporting in the php. ini file to display the script or not to display certain errors. Ini_set ('display _ errors ', 'on') displays an error.
Note:Error_reporting () sets the errors reported, while ini_set ('display _ errors ', 'on') sets whether an error is returned. Therefore, error_reporting (-1) and ini_set ('display _ errors ', 0) can be used as the setting log: Reports errors and does not output them.
Example: error_reporting (E_ALL &~ E_NOTICE) do not display notification-level errors. "~" Indicates not.