Team LiB
Previous Section Next Section

What to Do About Errors

When an error is raised, PHP's error-handling mechanism first checks to see if a custom error handler is defined. If it is, and the error being raised is not one of the following: E_ERROR, E_COMPILE_WARNING, E_COMPILE_ERROR, E_CORE_WARNING, E_CORE_ERROR, or E_PARSE), then that error handler is invoked; otherwise, the default error handler built in to PHP is called. After the error handler returns, PHP checks to see whether the error was a fatal one. If so, the currently running script is terminated; otherwise, execution resumes at the point where the error was raised. See Figure 14.1.

Figure 14.1. Diagram of the PHP's error-handling mechanism.


    Team LiB
    Previous Section Next Section