PHP Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
PHP Topics
Introduction Introduction
Syntax Syntax
Data Types Data Types
Operators Operators
Control Structures Control Structures
Functions Functions
Pre-defined Function Pre-defined Function
Calendar Functions Calendar Functions
Date and Time Date and Time
Array Functions Array Functions
Array List Array Functions List1
Array Function List Array Functions List2
Math Functions Math Functions
PHP MYSQL Functions PHP Mysql Functions
File Handling File Handling
Error Handling Error Handling
DB Size DB Size
PHP Mail PHP Mail
String Tokens String Tokens
String Functions String Functions
String Functions List String Functions List1
String Functions List2 String Functions List2
Session Functions Session Functions
Cookies Functions Cookies Functions
Form Variables Form Variables
Running PHP from JS Running PHP from JS
Array To JS Array To JS
JS Array Array to PHP
Encryption Encryption
Common Header Common Header
Forums Ask Your Doubts
Scraps More about PHP
Feedback Feedback
 




Error Levels in PHP


Tutorials »Php »

Topic

What are the different error levels supported in php?
or
What is the use of error levels?



Explanation

There are error levels in php with the help of which we can specify the type of error messages that should be displayed. Say we want only warning messages or compile errors to be displayed we will use the function error_reporting().

Code Used: e.g:
error_reporting(E_WARNING | E_COMPILE_ERROR);

To use error levels you should know when a type of error will occur. Here we have given the different message types supported by php.

Different Error Types:

NameBit ValueNote
E_ERROR1Fatal Errors that will halt script execution
E_WARNING2Non fatal Runtime Errors.
E_PARSE4Error generated by parser.
E_NOTICE8Run-time notices
E_CORE_ERROR16Error during PHP's initial startup
E_CORE_WARNING32Warning during PHP's initial startup
E_COMPILE_ERROR64Error generated by zend
E_COMPILE_WARNING128Warning generated by zend
E_USER_ERROR256Error generated by user using trigger_error() function
E_USER_WARNING512Warning generated by user using trigger_error() function
E_USER_NOTICE1024Notice generated by user using trigger_error() function
E_ALL2047Defines all messages except E_STRICT
E_STRICT2048

A basic user will not bother too much about error levels as he would use either 0 or E_ALL for error_reporting().

Next >> Error mailing or redirecting error messages to file.






Other Links

web hosting