The error_reporting () function kneels and you give the PHP error which should be reported. This
function can set the error_reporting directive 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.
Grammar
Error_reporting (level);
| Parameters |
Description |
| Level |
Optional. Specify the new error_reporting level. Can be a bitmask or it can be a named constant.
Note: It is strongly recommended to use a named constant to ensure compatibility with future versions. Because of the addition of the error level and the increase in the range of integer values, a longer integer-based error level does not always match the expected performance.
The available error level constants and their actual meanings are described in predefined constants. |
Example:
Any number of the above options can be connected (with OR or |) using "or" to report all required levels of errors.
For example, the following code turns off user-defined errors and warnings, performs certain actions, and then reverts to the original error level:
<?php//Disabling Error Reporting error_reporting (0); Report run-time error error_reporting (E_error | e_warning | E_parse); Report all error error_reporting (E_all);? >