Chapter 7
Exceptions and Objects
In This Chapter
Introducing PHP objects
Creating a constructor
Adding properties and methods to objects
Using access modifiers to protect data
Building sub-classes with inheritance
Trapping for errors with exception handling
PHP has become a critically important part of web programming, and it has undergone a number of important transformations. As PHP becomes more mainstream, it is adopting a number of features from more traditional languages. Two of these important features are object-oriented programming (OOP) and exception handling. Objects are re-usable components that encapsulate data and functions (first mentioned in Book IV, Chapter 4). Exception handling is a mechanism used to detect and gracefully recover from errors. Both object-oriented programming and exception handling are important parts of modern data programming, which is the heart ...
Get HTML5 and CSS3 All-in-One For Dummies, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.