Coding & Programming > PHP Forum

What are the main types of error in PHP and how do they differ?

(1/2) > >>

Hello guys,
What are the main types of error in PHP and how do they differ?

There are 3 types of error in Programming: Syntax Errors, Logical Errors(Semantic Errors) and Run-Time Errors.

Basically there are four types of errors in PHP, which are as follows:

1. Parse Error (Syntax Error)
2. Fatal Error
3. Warning Error
4. Notice Error

Well, there is certainly a slight difference between the different types and different kinds of errors in PHP
Basically, there are 3 types of errors in PHP, that are as follows :

1. Notices : 
These are small, non-critical errors These types of errors are not shown to the users.

2. Warnings : 
These are a bit more serious errors however they do not result in script termination. By default, these types of errors are shown to the user.
Warnings are more severe errors like attempting to include( ) a file which does not exist.

3. Fatal errors :
These are the most critical errors. These errors might cause due to immediate termination of a script.

Happy Coding..!!!  !-!

Different types of PHP errors are :

E_ERROR: A fatal error that causes script termination
E_WARNING: Run-time warning that does not cause script termination
E_PARSE: Compile time parse error.
E_NOTICE: Run time notice caused due to error in code
E_CORE_ERROR: Fatal errors that occur during PHP's initial startup (installation)
E_CORE_WARNING: Warnings that occur during PHP's initial startup
E_COMPILE_ERROR: Fatal compile-time errors indication problem with script.
E_USER_ERROR: User-generated error message.
E_USER_WARNING: User-generated warning message.
E_USER_NOTICE: User-generated notice message.
E_STRICT: Run-time notices.
E_RECOVERABLE_ERROR: Catchable fatal error indicating a dangerous error
E_ALL: Catches all errors and warnings

PHP Errors: 4 Different Types (Warning, Parse, Fatal, and Notice Error)


[0] Message Index

[#] Next page

Go to full version