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.

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

}<br />

echo $i . <strong>PHP</strong>_EOL;<br />

i<br />

Errors and Error Management<br />

Errors are an integral part of every computer language—although one that, most of<br />

the time, programmers would rather not have to deal with!<br />

<strong>PHP</strong> has some excellent facilities for dealing with errors that provide an excellent<br />

level of fine-grained control over how errors are thrown, handled and reported.<br />

Proper error management is essential to writing applications that are both stable and<br />

capable of detecting when the inevitable problem arises, thus handling failure in a<br />

graceful manner.<br />

In this chapter, we only cover <strong>PHP</strong>’s traditional facilities for error management in procedural<br />

code. <strong>PHP</strong> 5’s new object-oriented error management is discussed in the<br />

Object-oriented Programming in <strong>PHP</strong> chapter.<br />

Types of Errors<br />

There are several types of errors—usually referred to as error levels in <strong>PHP</strong>:<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!