8. Using Existing Classes

The preceding four chapters discuss object-oriented programming, discussing both syntax and theory. The majority of the examples in those chapters tend to be as much demonstrative as practical (e.g., the Rectangle, Square, Shape, and Triangle classes are useful, but only if you’re doing geometric work). Philosophical examples are best for teaching OOP, I believe, but real-world object-oriented programming hammers the points home. And nothing best demonstrates real-world OOP than using some of the many existing classes created by other developers.

All of the examples in this chapter are based ...

Get PHP Advanced and Object-Oriented Programming: Visual Quickpro Guide, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.