O'Reilly logo

PHP in Action: Objects, Design, Agility by Chris Shiflett, Marcus Baker, Dagfinn Reiersol

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Understanding class relationships

5.1 Inheritance 88
5.2 Object composition 94
5.3 Interfaces 96
5.4 Favoring composition over inheritance 99
5.5 Summary 101

Not long ago, I was watching a television talk show featuring actor Sven Nordin, who plays the Norwegian version of the solo theatrical performance Defending the Caveman. Nordin convincingly demonstrated the art of banging your head on a hard surface, although he did admit that it was a painful procedure.

A medical expert who was also present remarked dryly that “he shouldn’t be doing that.”

Obviously. It’s easy to understand how that kind of abuse might be bad for your brain. On the other hand, it might be a vicious cycle: the more you rattle your brain, the less you understand ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required