You are here: Home / Topics / Types of errors in PHP

Types of errors in PHP

Filed under: PHP on 2022-10-08 13:48:26

The 3 main types of errors in PHP are:

  • Notices: Notices are non-critical errors that can occur during the execution of the script. These are not visible to users. Example: Accessing an undefined variable.
  • Warnings: These are more critical than notices. Warnings don’t interrupt the script execution. By default, these are visible to the user. Example: include() a file that doesn’t exist.
  • Fatal: This is the most critical error type which, when occurs, immediately terminates the execution of the script. Example: Accessing a property of a non-existent object or require() a non-existent file.
About Author:
D
Deepak Sahoo     View Profile
I am preparing for UPSC. My dream is to be IAS.