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 13SPL Exceptions

The SPL provides a number of built-in exception base classes that are designed to handle everyday scenarios. In this chapter, you will learn about the base exception classes, when to apply them, and how to extend them for your own requirements.

Logic Exceptions

The SPL has two central classes of exceptions: LogicException and RuntimeException (discussed in the next section). The LogicException class descends from Exception directly, and does not add any additional methods.

class LogicException extends Exception

The purpose of this classification is to allow you to differentiate between compile-time logical exceptions and exceptions caused by bad data being passed to the application.

Invoking a logic exception is just ...

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