
Master the basics of PHP object oriented programming, including classes, objects, properties, methods, and visibility. Explore encapsulation, inheritance, polymorphism, abstractions, namespaces, traits, interfaces, and abstract classes for testable, reusable code.
Skip the introductory videos if you've already downloaded VS Code and exam, and start the PHP OOP crash course right away.
Install Xampp to set up a local development server with Apache, MySQL, PHP, and phpMyAdmin, with optional Perl, then run localhost to verify the setup.
Install Visual Studio Code on Windows and set up the editor, following download and installation steps, then start coding with me, noting that other editors also work.
Explore what object oriented programming in PHP is today. See how encapsulation, abstraction, inheritance, and polymorphism with classes and objects improve organization and reuse.
Explore how PHP uses classes as blueprints and how objects instantiate those classes. Learn naming conventions, single class per PHP file, and creating objects with the new keyword.
Explore properties and methods in PHP object-oriented programming, learning how to declare public properties, access them with the object operator, and define and call public methods with parameters.
Learn how this keyword references the current object to access properties and methods inside a PHP class, using the object operator, with name and password examples.
Explore private properties in PHP OOP, contrasting them with public visibility and why access should be restricted. Implement getter and setter methods to control external access and apply custom logic.
Learn how PHP magic methods work, focusing on constructor and destructor to initialize objects, manage resources, and clean up when objects are created or destroyed.
Learn how encapsulation bundles data and restricts direct access in PHP objects, exposing controlled access via getter and setter methods to protect internal state.
Explore inheritance in PHP, where a child class extends a parent class to reuse properties and methods, enabling code reusability, extensibility, and method overriding.
Explore how constructors behave in PHP inheritance, including automatic parent constructor calls, child constructor overrides, and calling parent constructors with parent::__construct, demonstrated with animal and dog examples.
Learn how to override methods in a parent class within a child class, extend behavior by invoking the parent method, and use the final keyword to prevent overriding.
Explore how the protected keyword governs access to properties like age and methods within a class and its subclasses, while remaining inaccessible from outside code.
Master polymorphism with abstract classes that define a common interface for different subclasses. Implement abstract methods as contracts and see how subclasses override behavior, while abstract classes cannot be instantiated.
Explore interfaces as contracts in PHP, where implementing classes must define public methods, interfaces cannot have properties, and a class can implement multiple interfaces, unlike abstract classes.
Explore polymorphism with multiple interfaces in PHP by implementing several interfaces, using type hinting to trigger makesound and running methods on dog and cat classes.
Master static properties and methods that belong to the class, accessible without objects using the scope resolution operator. Learn how self and this relate to class versus object access.
Explore class constants in PHP by using the const keyword, accessed via the class name with the scope resolution operator; they cannot change and can be overridden in child classes.
Learn how abstraction uses abstract classes and abstract methods to define a base contract, hide implementation details, and enable reusable, flexible PHP object-oriented programming.
Explore PHP traits as a code reuse mechanism in a single inheritance language, using traits to share methods and properties across classes, without instantiating them, with practical examples.
Learn how namespaces organize classes to avoid redeclare errors, create local scopes, and access namespaced classes using fully qualified names or aliases.
Are you ready to take your PHP skills to the next level?
This crash course is designed for PHP developers who understand the basics of the language and want to quickly dive into the powerful world of Object-Oriented Programming (OOP) — a must-have skill for any serious backend developer today.
In just a few hours, you’ll learn the core principles of OOP in PHP through clear, focused explanations and hands-on examples. We cut through the fluff and go straight to what matters, helping you understand and apply concepts like classes, objects, constructors, access modifiers, and the crucial $this keyword.
You'll learn how to organize your code using inheritance, extend the functionality of classes, and use abstract classes and interfaces to enforce structure in your applications. You'll also discover how polymorphism allows your code to become more flexible and easier to maintain — all without getting overwhelmed.
We also dive into encapsulation, explaining why it matters and how to protect the internal state of your objects using getters and setters. To round it out, you’ll get a practical intro to namespaces, giving your code structure and scalability from the start.
Whether you’re preparing for a job, switching to modern PHP practices, or simply leveling up, this crash course gives you the solid foundation you need.
No frameworks, no Composer, no distractions. Just pure OOP PHP, explained simply.