Objects and classes lie at the heart of this book and, since the introduction of PHP 5 over a decade ago, they have lain at the heart of PHP, too. In this chapter, I lay down the groundwork for more in-depth coverage of objects and design by examining PHP’s core object-oriented features. If you are new to object-oriented programming, you should read this chapter carefully.
This chapter will cover the following topics:
Classes and objects: Declaring classes and instantiating objects
Constructor methods: Automating the setup of your objects
Primitive and class types: Why type matters
Inheritance ...