Error Reporting
Types of Errors in PHP
Before we can get into remedying ugly error messages on your site, you need to understand the different types of errors. PHP4 can produce 11 different errors, as defined in Table 8-1 below (note that fatal errors stop the script from executing):
NAME | VALUE | DESCRIPTION |
---|---|---|
E_ERROR | 1 | Fatal error that occurs at script runtime. |
E_WARNING | 2 | Nonfatal error that occurs at runtime (for example, if the script is unable to connect to MySQL). |
E_PARSE | 4 | Error that occurs at compile time due to invalid syntax. |
E_NOTICE | 8 | Nonfatal “notice.” Not exactly an error, but a hint that you may be doing something you don't want to, such as dividing a number by zero. |
E_CORE_ERROR | 16 | Fatal error that occurs ... |
Get Advanced PHP for Web Professionals now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.