The error_reporting () function kneels and you give the PHP error which should be reported. This function to set the error_reporting instruction at run time.
PHP has many error levels that you can use to set the level at which the script runs. If you do not set an optional parameter, level,error_reporting () returns only the current error reporting level.
Error Reporting Level: Specifies the circumstances under which the error in the script code (where the error is generalized, including e_notice attention, e_warning warning, e_error fatal error, etc.) is output in the form of an error report. To set the error reporting level method:
Modify PHP config file php.ini this way after setting error_reporting, restarting the Web server will take effect forever. Take the XAMPP integration package as an example, open the profile php.ini and see the default values for error report level error_reporting, as follows: Error_reporting=e_all & ~e_deprecated & ~e_ STRICT means to report all errors, but in addition to the e_deprecated and e_strict of the two. Modify it to: Error_reporting=e_all & ~e_notice means to report all errors, except E_notice. This is also the most commonly used error reporting level, and it does not report errors that note classes (such as those that use undefined variables). Save and take effect after restarting the Web server.
This method, which is set using the error_reporting () function , can take effect immediately. But limited to the following area of the error_reporting () function call in the current script. the int error_reporting ([int $level]) parameter can be an integer or a corresponding constant identifier, and it is recommended to use the form of a constant. The return value is the value of the error report level at the current position (integer value).
Some error reporting levels are listed below:
1. E_error reports a fatal error that causes the script to terminate running
2. E_warning Report Runtime warning class error (script does not terminate running)
4. E_parse report compile-time parsing errors
8. E_notice report notification class error, script may produce error
32767 E_all Report all possible errors (different PHP versions, constant E_all values may also vary)
Error_reporting (e_all ^ e_notice); All errors are reported except for E_notice
Error_reporting (E_error); Only fatal errors are reported
echo error_reporting (E_error | e_warning | E_notice); Only reports E_error, e_warning, and e_notice three kinds of bad job alerts: The default value of Display_errors in the profile php.ini is on, which means that the error prompt is displayed, and if set to OFF, all error prompts are turned off.