This directive informs PHP of which errors, warnings and notices you would like it to take action for. The recommended way of setting values for this directive is through the use of the error level constants and bitwise operators. The error level constants are below here for convenience as well as some common settings and their meanings.

By default, PHP is set to take action on all errors, notices and warnings EXCEPT those related to E_NOTICE and E_STRICT, which together cover best practices and recommended coding standards in PHP.

For performance reasons, this is the recommend error reporting setting. Your production server shouldn't be wasting resources complaining about best practices and coding standards.

That's what development servers and development settings are for. Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This means it pretty much reports everything which is exactly what you want during development and early testing.

; error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED

The following ERROR level have in Common error reporting.

  • E_ALL & ~E_NOTICE - This error level will show all errors, except for notices and coding standards warnings.
  • E_ALL & ~E_NOTICE   |   E_STRICT - This error level will show all errors, except for notices
  • E_COMPILE_ERROR  | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR- This error level will Show only errors
  • E_ALL | E_STRICT - This error level is Show all errors, warnings and notices including coding standards

Note : The error_reporting directive uses the tilde character (~) to represent the logical operator NOT.

The error_reporting directive determines the reporting sensitivity level. Sixteen separate levels are available, and any combination of these levels is valid .