PHP OOP Basics
Object-Oriented Programming organises code into classes (blueprints) and objects (instances).
Key Concepts
- Class — template/blueprint
- Object — instance of a class
- Properties — data
- Methods — functions
- Constructor —
__construct()
Visibility
public— accessible anywhereprotected— accessible in class and subclassesprivate— accessible only in the class itself