top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are the different types of Error in PHP?

+1 vote
414 views
What are the different types of Error in PHP?
posted May 22, 2014 by Amritpal Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

+2 votes

Here are three types of errors which you can face at runtime in PHP:

  1. Notices: Non-critical errors that PHP encounters while executiion i.e. accessing an undefined variable.

  2. Warnings: These are more serious then notices and like the attention of the developer i.e. attempting to include() a file which does not exist. By default these errors 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.

answer May 23, 2014 by Salil Agrawal
+1 vote

Your question is very very generic in nature so let me answer it straight

Being a programming language PHP can cause the same kind of syntax and semantics errors that you experience in other languages. Plus it can throw some of the inbuilt exceptions. Code more to learn more

answer May 22, 2014 by Shyam Purkayastha
+1 vote

There are three types of errors that you can have in PHP.
1.NOTICES: These are trivial,non critical errors that PHP encounters while executing a script. e.g. Accessing a variable that has not been defined yet.
2. WARNINGS: These are more serious errors which occur when you try to include a file which does not even exist. These errors are displayed to the user,but they do not result in script termination.
3.FATAL ERRORS: These are critical errors which terminate the script. These Kind of errors occur while calling a function which does not exist or during instantiating an object of a non-existent class .

answer May 23, 2014 by Mohit Sharma
...