Chapter 2. Object-Oriented PHP

DESPITE BEING A RELATIVELY RECENT—and often maligned—addition to the computer programming world, object-oriented programming (OOP) has rapidly taken hold as the programming methodology of choice for the enterprise.

The basic concept behind OOP is encapsulation—the grouping of data and code elements that share common traits inside a container known as a class. Classes can be organized hierarchically so that any given one can inherit some or all the characteristics of another one. This way, new code can build on old code, making for more stable and reliable code (at least, in theory).

Because it was added by the designers almost as an afterthought, the implementation of OOP in PHP 4 differs from the traditional ...

Get Zend PHP Certification Study Guide 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.