7.1. Introduction

You can reduce the number of errors in your application by using good programming practices; however, many factors cause errors that are beyond our control in a script. Network outages, full hard disks, hardware failure, bugs in other PHP components, or programs your application interacts with can all cause errors that are not due to any fault of your PHP code.

If you do nothing to deal with such errors, PHP's default behavior is to show the error message to the user, along with a link to the page in the manual describing the function that failed, as well as the file name and line of the code that triggered the error. For most errors, PHP keeps running after displaying this message. See Figure 7.1.

Figure 7.1. PHP error message. ...

Get PHP 5 Power Programming 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.