What are the types of errors in PHP?

Questions by shilpak10   answers by shilpak10

Showing Answers 1 - 9 of 9 Answers

James

  • May 3rd, 2007
 

Three are three types of errors:

1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although, as you will see, you can change this default behaviour.

2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.

3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP's default behaviour is to display them to the user when they take place.

mrudul.ce

  • Dec 4th, 2010
 

Different type of errors are as following:


1. E_ERROR : Fatal run-time errors.


2. E_WARNING : Run-time warning.


3. E_PARSE : Compile time parse error.


4. E_NOTICE : Run time notice.


5. E_CORE_ERROR : errors that occur during PHP's initial startup.


6. E_CORE_WARNING : Warnings (non-fatal errors) that occur during PHP's
initial startup.


7. E_COMPILE_ERROR : Fatal compile-time errors.


8.E_USER_ERROR : User-generated error message.


9.E_USER_WARNING : User-generated warning message.


10. E_USER_NOTICE : User-generated notice message.


11.E_STRICT : Run-time notices. Enable to have PHP suggest changes to your
code which will ensure the best interoperability and forward compatibility of
your code.


12.E_RECOVERABLE_ERROR :Catchable fatal error. It indicates that a probably
dangerous error occured, but did not leave the Engine in an unstable state.


13.E_ALL : All errors and warnings, as supported, except of level E_STRICT in
PHP


abc

  • Sep 12th, 2011
 

1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although, as you will see, you can change this default behaviour.

2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.

3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP's default behaviour is to display them to the user when they take place.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions