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 ...