PHP error_reporting() Function

The error_reporting() function specifies which errors are reported.

PHP has many levels of errors, and using this function sets that level for the current script.

Example -

Specify different error level reporting:

ParameterDescription
levelOptional. Specifies the error-report level for the current script. Error numbers and named constants are accepted. Note: Named constants are recommended to ensure compatibility for future PHP versions