O'Reilly logo

Advanced PHP for Web Professionals by Christopher Cosentino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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):

Table 8-1. PHP Error Types
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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required