October 2006
Intermediate to advanced
720 pages
17h 56m
English
Exception handling deals with managing run-time errors. The process is very similar to run-time error management as covered in the preceding section. Run-time error management was the only exception handling process available prior to PHP 5.
PHP 5 exception handling was introduced by adopting into the language a set of tools familiar to C++ and Java programmers. These tools include an Exception class, try and catch blocks, and a throw operator. You will review these features of the language in the next four sections.
The try block encloses code that can encounter an error. For every try block, there must be at least one catch block, but there can be more than one catch block. The benefit of having more ...
Read now
Unlock full access