O'Reilly logo

Pro PHP Programming by Mladen Gogala, Peter MacIntyre, Brian Danchilla

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

C H A P T E R  2

Exceptions and References

In this chapter, we will explore exceptions and references, two fundamental aspects of modern object-oriented programming (OOP). Exceptions are synchronous events. The word “synchronous” means that they're reactions to events in the code itself, not reactions to external events, like signals. For instance, when an operator presses Ctrl-C on the keyboard, a signal is sent to the executing program. Exceptions are used for handling errors in an orderly, standard-compliant way. When the program (or a script, in the case of PHP) attempts to perform division by zero, an exception is raised. Exceptions can be raised (or thrown) and caught. Raising an exception actually means passing the program control to ...

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