
Explore PHP object oriented programming, from fundamentals to advanced topics, including classes, objects, properties, methods, and encapsulation, inheritance, polymorphism, abstraction; cover visibility, namespaces, traits, and interfaces for reusable, testable code.
This lecture explains the this keyword in PHP, referencing the current object to access properties and methods inside a class using the object operator; it shows printing name and password.
Learn how PHP magic methods like constructors and destructors initialize objects, manage resources, and clean up when objects are destroyed, with practical examples of passing parameters and opening/closing connections.
Explore inheritance in PHP, where a child class extends a parent to reuse and override methods, promoting code reusability and extensibility.
Polymorphism lets objects from different classes share a common parent and implement the same method differently. The video explains abstract classes, abstract methods, and contracts with concrete subclass examples.
Explore interfaces in PHP as a contract that implementing classes must follow, with only public methods and no properties; a class can implement multiple interfaces, enabling polymorphism.
Master static properties and methods in PHP, accessed without objects via the class name and scope resolution operator, and compare self, this, and static for real-world use.
Master class constants in PHP using the const keyword, accessed via the class name, whose values cannot change. Explore inheritance and overriding for fixed configuration values.
Explore PHP magic methods, double-underscore functions invoked on object actions, with focus on get and set for handling non-existent or private properties.
Explore magic methods __toString and __invoke in PHP object-oriented programming, showing how __toString converts an object to a string and how __invoke lets an object act as a function.
Explore type hinting and return type declarations in PHP 7, showing how parameter types and return values validate data with practical examples, strict types, and self-documenting interfaces.
Explore how to use properties in traits, apply two traits to a single class, and resolve trait method conflicts with insteadof and aliases in PHP.
Configure autoloading with spl_autoload_register and namespaces to automatically load classes from multiple folders as they are instantiated, mapping namespaces to directory paths.
Create a php object oriented project by organizing source, public, and views folders; implement models, controllers, a core database class, and an auto load file with a bootstrap template.
Create a post model in PHP object‑oriented programming that provides static methods to get all posts, get a single post, and create posts via a PDO database connection.
Update posts by loading existing data with get_single, displaying it in a form, and submitting changes through the post controller's update method, while sanitizing output to prevent XSS.
Develop and wire PHP object-oriented routes and controllers, creating a home controller and a posts controller to handle get and post requests and load views.
Connect to the database via a db connection file, extend a db class for CRUD operations, and build a post model to interact with the database via a controller.
Learn to insert new posts with PHP object oriented programming by creating a store method, preparing and executing an insert into the posts table from the create form.
Explore object cloning in PHP by using the clone keyword to create true copies, distinguishing shallow from deep copying with practical Book class examples.
Are you ready to take your PHP skills to the next level? If you've been writing basic PHP scripts using procedural code and want to learn how to write more organized, reusable, and professional-grade applications, this course is for you.
This course is a complete introduction to Object-Oriented Programming (OOP) in PHP, carefully designed for beginners and self-taught developers who may have little or no experience with OOP. You'll be guided step-by-step through the essential concepts that form the foundation of object-oriented programming, helping you truly understand not just how to write object-oriented code — but why it matters.
We’ll begin with the fundamentals of classes and objects, and you’ll quickly move on to learning about properties, methods, constructors, and visibility (public, private, protected). From there, we’ll explore powerful features like inheritance, method overriding, polymorphism, and encapsulation, showing how they can simplify complex applications and reduce code duplication.
You’ll also learn how to use abstract classes, interfaces, and traits to write flexible, extendable code that’s easier to maintain. Along the way, you'll gain clarity on how OOP promotes better code organization by separating responsibilities across well-defined objects.
The course will also cover namespaces, autoloading using PSR-4, and how to structure your application folders in a modern way. These skills are essential if you plan to work on larger projects or eventually dive into PHP frameworks like Laravel or Symfony.
Every topic is explained in simple, beginner-friendly language, with plenty of practical examples to reinforce your understanding. You won’t just memorize syntax — you’ll learn how to think in objects, break down a problem into logical components, and write clean, well-structured code that scales as your application grows.
By the end of this course, you will have a strong foundation in object-oriented PHP and the confidence to start applying these skills to your own projects — or take the next step toward learning a PHP framework with ease.