·  PHP – Terms – Errors – Directives –  error_reporting

 

- Info:

  - error_reporting directive determines which errors will be reported.

  - Fourteen separate levels are available, and any combination of these levels is valid.

  - Each error level, shown in following table, includes all levels residing below it.

  - You can use logical operators to more specificly specify which errors and warning should be reported.

 

    

ERROR LEVEL

DESCRIPTION

 

E_ALL

All errors and warnings

 

E_COMPILE_ERROR

Fatal compile-time errors

 

E_COMPILE_WARNING

Compile-time warnings

 

E_CORE_ERROR

Fatal errors that occur during PHP’s initial start

 

E_CORE_WARNING

Warnings that occur during PHP’s initial start

 

E_ERROR

Fatal run-time errors

 

E_NOTICE

Run-time notices

 

E_PARSE

Compile-time parse errors

 

E_RECOVERABLE_ERROR

Near-fatal errors (introduced in PHP 5.2)

 

E_STRICT PHP

version portability suggestions (introduced in PHP 5.0)

 

E_USER_ERROR

User-generated errors

 

E_USER_NOTICE

User-generated notices

 

E_USER_WARNING

User-generated warnings

 

E_WARNING

Run-time warnings

 

    

LOGICAL OPERATORS

DESCRIPTION

 

|

OR

 

&

AND

 

~

NOT

 

- Example:

  - Create PHP Console Application Test.php.

 

    Test.html

    <?php

   

      error_reporting(E_ALL);

      error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);

      error_reporting(E_ALL & ~(E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE));

      

    ?>