Object inheritance

The OOP paradigm places objects at the heart of application design, where objects can be looked at as units that contain various properties and methods. Interaction between these properties and methods defines the internal state of an object. Every object is built from a blueprint called a class. There is no such thing as an object without the class, at least not in a class-based OOP.

We differentiate class-based OOP (PHP, Java, C#, ...) and prototype-based OOP (ECMAScript / JavaScript, Lua, ...). In class-based OOP, objects are created from classes; in prototype-based OOP, objects are created from other objects.

The process of building or creating new objects is called instantiation. In PHP, like many other languages, ...

Get Mastering PHP 7 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.