5. Object-Oriented Programming
Overview
By the end of this chapter, you will be able to declare classes with constants, attributes, and methods; instantiate a class; work with constructors and destructors; implement class inheritance, access modifiers, static fields, and methods; use class type hinting as dependency injection; use attribute and method overriding; apply attribute and method overloading via magic methods; use final classes and methods; autoload classes; and use traits and apply namespacing.
To summarize, we will have a look at Object-Oriented Programming (OOP) concepts that can be leveraged to write modular code.
Introduction
In order to understand the Object-Oriented Programming (OOP) approach, we should start by discussing ...
Get The PHP Workshop 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.