C H A P T E R  1

Object Orientation

The purpose of this chapter is to introduce the basic concepts of object orientation. What does it actually mean to say, “PHP is object oriented?” The simplest answer is that PHP allows for the definition and hierarchical organization of user data types. This book is about PHP 5.3, which introduced some new elements to PHP object apparatus. PHP underwent a fairly radical change since the version 4, which also included rudimentary object-oriented (OO) capabilities. In PHP 4, for instance, it wasn't possible to define visibility of methods and members. In PHP 5.3, namespaces were added.

In this chapter we will introduce the ideas of classes, inheritance, object creation, and interface definition. We will also ...

Get Pro PHP Programming 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.