O'Reilly logo

PHP 5 Power Programming by Derick Rethans, Stig Sæther Bakken, Andi Gutmans

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

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. ...

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