Chapter 6. Object-Oriented PHP

This chapter explains concepts of object-oriented (OO) development and shows how they can be implemented in PHP. PHP5 introduces a new, more powerful object-oriented implementation, which makes classes and objects more useful.

Now PHP's OO implementation has all the features you would expect in a fully object-oriented language. We point out each of the new features as we go through this chapter for those of you who have previously used PHP4 or earlier.

Key topics covered in this chapter include

  • Object-oriented concepts

  • Classes, attributes, and operations

  • Class attributes

  • Per-class constants

  • Class method invocation

  • Inheritance

  • Access modifiers

  • Static methods

  • Type hinting

  • Object cloning

  • Abstract classes

  • Class design

  • Implementation ...

Get PHP and MySQL Web Development, 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.