Different Types of PHP Errors

When something goes wrong in the PHP code, it causes a PHP Error. It might be as easy as omitting a semicolon or as complicated as invoking the wrong variable.

There are four types of PHP Errors:

1. Warning Error- A warning error in PHP does not stop the script from running. It only warns you that there is a problem, one that is likely to cause bigger issues in the future.

2. Notice Error- Notice errors are minor errors. They are similar to warning errors, as they also don’t stop code execution. Often, the system is uncertain whether it’s an actual error or regular code. Notice errors usually occur if the script needs access to an undefined variable.

3. Parse Error- Parse errors are caused by misused or missing symbols in a syntax. The compiler catches the error and terminates the script. Parse errors are caused by:

  • Unclosed brackets or quotes
  • Missing or extra semicolons or parentheses
  • Misspellings

4. Fatal Error- Fatal errors are ones that crash your program and are classified as critical errors. An undefined function or class in the script is the main reason for this type of error.

Sources:

https://phoenixnap.com/kb/php-error-types

Leave a Comment

Your email address will not be published. Required fields are marked *