O'Reilly logo

Pro PHP: Patterns, Frameworks, Testing and More by Kevin McArthur

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

CHAPTER 4Exceptions

Introduced in PHP 5, exceptions are a critical part of any OOP application. The term exception refers to the entire machinery of try, catch, and throw statements, and the Exception class. This machinery is designed to help you define when a problem occurs and what the code should do when a problem is encountered.

Exceptions give you control over how your program generates and handles errors. Exceptions also make your programming life easier by providing details about the context of the exception. By using exceptions, you will be able to create more robust applications that are fault-tolerant and that can inform an administrator when problems arise.

In this chapter, I will show you how to use built-in exceptions, as well as ...

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