Learn What Are The Different Types Of Errors In PHP

admin_img Posted By Bajarangi soft , Posted On 18-09-2020

Error is the mistake in a code. It can be any types of error .Error can occur due to syntax or logic mistakes. It is a type of mistakes or condition of having incorrect knowledge of the code.

What are the different types of errors in PHP

There are various types of errors in PHP but we discuss basic four main type of errors in PHP.

Parse error or Syntax Error: 
The syntax error is caught by the compiler. After fixing the syntax error the compiler compile the code and execute it.
Parse errors can be caused dues to Unclosed quotes, missing or Extra parentheses, Unclosed braces, Missing semicolon etc

 

Fatal Error:
It is the type of error where PHP compiler understand the PHP code but it recognizes an undeclared function.


Warning Errors :
The main reason of warning errors are including a missing file. This means that the PHP function call the missing file.


Notice Error:
It is similar to warning error. It means that the program contains something wrong but it allows the execution of script.error likes Undefined variable but also you get that variable value


 

PHP error  description

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_DEPRECATED                 Run-time notices.

Related Post