Chapter 2. BASICS OF OBJECT-ORIENTED PROGRAMMING

This chapter is aimed at an audience unfamiliar with the basic concepts of object-oriented programming (OOP). The intent is to provide a general overview of OOP with a view toward using PHP effectively. We'll restrict the discussion to a few basic concepts of OOP as it relates to PHP, though it is sometimes useful to look at other object-oriented (OO) languages such as Java or C++.

We'll discuss three aspects of object orientation in this chapter: class, access modifiers, and inheritance. Although OOP may be a different programming paradigm, in many respects it's an extension of procedural programming, so where appropriate, I'll use examples from procedural programming to help explain these concepts. ...

Get Object-Oriented PHP 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.