Easy Tutorial
❮ Func Cal Jdtofrench Func Array Merge Recursive ❯

PHP error_reporting() Function



Definition and Usage

The error_reporting() function specifies which errors are reported.

This function sets the error reporting level for the current script.

It returns the old error reporting level.

Syntax

Parameter Description
report_level Optional. Specifies the error reporting level for the current script. Both numeric values and constant names are accepted, but it is recommended to use constant names for future compatibility with PHP versions.

Reporting Levels

Value Constant Description
1 E_ERROR Fatal run-time errors. These indicate errors that cannot be recovered from. Script execution is halted.
2 E_WARNING Non-fatal run-time errors. Script execution is not halted.
4 E_PARSE Compile-time parse errors. Parse errors should only be generated by the parser.
8 E_NOTICE Run-time notices. Indicates that the script encountered something that could indicate an error, but could also happen in the normal course of running a script.
16 E_CORE_ERROR Fatal errors that occur during PHP's initial startup. This is like an E_ERROR generated by the PHP core.
32 E_CORE_WARNING Non-fatal errors that occur during PHP's initial startup. This is like an E_WARNING generated by the PHP core.
64 E_COMPILE_ERROR Fatal compile-time errors. This is like an E_ERROR generated by the Zend Scripting Engine.
128 E_COMPILE_WARNING Non-fatal compile-time errors. This is like an E_WARNING generated by the Zend Scripting Engine.
256 E_USER_ERROR User-generated fatal error. This is like an E_ERROR generated by the PHP function trigger_error().
512 E_USER_WARNING User-generated non-fatal error. This is like an E_WARNING generated by the PHP function trigger_error().
1024 E_USER_NOTICE User-generated notice. This is like an E_NOTICE generated by the PHP function trigger_error().
2048 E_STRICT Run-time notices. PHP suggests changes to your code to ensure interoperability and forward compatibility.
4096 E_RECOVERABLE_ERROR Catchable fatal error. This is like an E_ERROR that can be caught by a user-defined handle (see set_error_handler()).
8191 E_ALL All errors and warnings, except E_STRICT (E_STRICT will be part of E_ALL as of PHP 6.0).

Examples


❮ Func Cal Jdtofrench Func Array Merge Recursive ❯