Error_reporting () function usage, errorreporting
The first thing to know is that the error_reporting () function is used to set the error level and return the current level. It has 14 error levels, as follows:
1 E_error Fatal Run-time error. The error cannot be recovered. Execution of the script is paused
2 e_warning non-fatal run-time error. Execution of the script does not stop
4 E_parse Compile-time parse error. Parsing errors should only be generated by the parser
8 E_notice run time notification.
E_core_error fatal error when PHP is started. This is like a e_error in the PHP core
E_core_warning a non-fatal error when PHP is started. This is like a e_warning warning in PHP core
E_compile_error Fatal compile-time error. This is like a e_error generated by the Zend scripting engine
E_compile_warning non-fatal compile-time error, a e_warning warning generated by the Zend scripting engine
The e_user_error fatal user-generated error.
E_user_warning a non-fatal user-generated warning.
1024x768 E_user_notice user-generated notifications.
2048 e_strict run time notification.
4096 E_recoverable_error catch a fatal error.
8191 E_all to all the errors and warnings.
It seems that PHP does not turn on the error by default, so you need to configure the php.ini file:
Change display_errors = Off to display_errors = On
Also configure the error level:
error_reporting = E_all instead:
error_reporting = E_all & ~e_notice
The default for PHP is to display all errors, and some harmless hints we do not need to display, so set up as above!
You can also use the following in PHP code:
- Php
- Disable error reporting, i.e. do not display errors
- Error_reporting(0);
- Report Run-time errors
- Error_reporting(e_error | E_warning | E_parse);
- Report All Errors
- Error_reporting(e_all);
- ?>
http://www.bkjia.com/PHPjc/1048723.html www.bkjia.com true http://www.bkjia.com/PHPjc/1048723.html techarticle error_reporting () function usage, errorreporting first know that the error_reporting () function is used to set the error level and return the current level. It has 14 error levels, as follows: 1 e_e ...