Chapter 2. Basic Concepts in OOP

Two elements are needed to form a truth—a fact and an abstraction.

Remy de Gourmont

Beware how you trifle with your marvelous inheritance, this great land of ordered liberty, for if we stumble and fall, freedom and civilization everywhere will go down in ruin.

Henry Cabot Lodge

Everybody gets everything handed to them. The rich inherit it. I don’t mean just inheritance of money. I mean what people take for granted among the middle and upper classes, which is nepotism, the old-boy network.

Toni Morrison

Our normal waking consciousness, rational consciousness as we call it, is but one special type of consciousness, whilst all about it, parted from it by the filmiest of screens, there lie potential forms of consciousness entirely different.

William James

Abstraction

If you’re new to OOP, don’t expect everything to make sense right away. As you use OOP more and more, you’ll experience little “aha!” moments when the pieces begin to come together. PHP does have important OOP features, and it has its own way of implementing these features in the language. If you are familiar with other OOP languages, you can be assured that PHP is different in places—like allowing constants to be a part of an interface. Understanding abstraction is a cornerstone in both OOP and design patterns, and the more you use it, the more sense it makes.

The notion of abstraction is so essential to both object-oriented programming and design patterns that it bears more than a fleeting consideration. ...

Get Learning PHP Design Patterns 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.