PHP error handling - predefined constants
Predefined constants
Here is a list of the predefined constants used in PHP 5 for error handling :
Name | Type | Description | value |
---|---|---|---|
E_ERROR | integer | Execution of the script comes to a halt. An example is memory allocation problem. | 1 |
E_WARNING | integer | Execution of the script is not halted, warnings generated. | 2 |
E_PARSE | integer | Parse errors generated by parsers during compilation. | 4 |
E_NOTICE | integer | Run-time notices which indicated that may be an error took place but may also be a normal course of action. | 8 |
E_CORE_ERROR | integer | Fatal errors that occur during the initial startup of PHP. | 16 |
E_CORE_WARNING | integer | Warnings (execution of script is not halted) that occur during PHP's initial startup. | 32 |
E_COMPILE_ERROR | integer | Fatal compile-time errors. | 64 |
E_COMPILE_WARNING | integer | Compile-time warnings, execution of script is not halted. | 128 |
E_USER_ERROR | integer | User-generated error message. | 256 |
E_USER_WARNING | integer | User-generated warning message. | 512 |
E_USER_NOTICE | integer | Same as E_NOTICE. Only difference is, trigger_error() function is used here to generate the error message. | 1024 |
E_STRICT | integer | User-generated notice message. | 2048 |
E_RECOVERABLE_ERROR | integer | Catchable fatal error. | 4096 |
E_DEPRECATED | integer | Run-time notices. | 8192 |
E_USER_DEPRECATED | integer | User-generated warning message. | 16384 |
E_ALL | integer | All errors and warnings, as supported. Exception level E_STRICT. | 30719 |
All these constants are available in php.ini of your PHP installation folder.