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