25.09.2014 Views

ZEND PHP 5 Certification STUDY GUIDE

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PHP</strong> Basics ” 35<br />

As you can see, the function name of the old error handler (if any) is returned by the<br />

call to set_error_handler()—this allows you to stack several error handlers on top of<br />

each other, thus making it possible to have different functions handle different kinds<br />

of errors.<br />

It’s important to keep in mind that your error handler will completely bypass <strong>PHP</strong>’s<br />

error mechanism—meaning that you will be responsible for handling all errors, and<br />

stopping the script’s execution if necessary.<br />

i<br />

As of <strong>PHP</strong> 5, set _error_handler() supports a second parameter that allows you to specify<br />

the types of errors that a particular handler is responsible for trapping. This parameter<br />

takes the same constant values as the error_reporting() function.<br />

Summary<br />

This chapter covered many of the essentials of any <strong>PHP</strong> application. While simple,<br />

they are the building block of any application and, therefore, you should be completely<br />

familiar with them, their capabilities and any special requirements that they<br />

have.<br />

There are some fundamental elements that we have only glossed over here: arrays,<br />

strings, functions and objects. These are complex enough to warrant their own<br />

section of the book and are, therefore, covered in the next four chapters.<br />

Licensed to 482634 - Amber Barrow (itsadmin@deakin.edu.au)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!