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

Author Topic: What are the main types of error in PHP and how do they differ?  (Read 16320 times)

Offline susanburlingTopic starter

  • Trade Count: (0)
  • Jr. Member
  • **
  • Thank You 5
  • Posts: 71
  • Karma: 1
  • Gender: Female
    • PHP Development Company
Hello guys,
What are the main types of error in PHP and how do they differ?


Offline johnv5

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 13
  • Karma: 0
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

Offline EugeneHill

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 1
  • Posts: 22
  • Karma: 0
  • Gender: Male
    • TechTIQ Solutions | App Development Agency in London
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..!!!  !-!
« Last Edit: 03-20-2019, 05:17:48 by EugeneHill »

Offline Michealyardy

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 120
  • Karma: 0
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

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
2150 Views
Last post 07-26-2012, 04:56:13
by Die Hard
9 Replies
5631 Views
Last post 05-29-2019, 00:37:49
by EugeneHill
0 Replies
736 Views
Last post 02-16-2017, 03:36:00
by jeyavinoth
5 Replies
4296 Views
Last post 07-11-2018, 05:37:57
by organictextiles
1 Replies
1006 Views
Last post 09-29-2018, 19:25:40
by marrysmith101