
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.
Skip the second two videos if you already downloaded VS code and exam, and start the PHP object oriented programming course 2025 right away.
Install xampp to set up a local development server with apache, mysql, php, phpmyadmin, and perl; configure components, start services, and verify via localhost.
Install Visual Studio Code on Windows, accept the agreement, and create desktop icon to launch editor. Open editor, start coding, or use alternatives like PHPStorm, Sublime, or text plus plus.
Understand object oriented programming as a PHP paradigm that organizes code into classes and objects with properties and methods, enabling better organization, reuse, and scalability.
Explore classes as blueprints and objects as instantiations in PHP, covering naming conventions, one class per file, and creating objects with new.
Explore an introduction to properties and methods in PHP object oriented programming, highlighting public properties, visibility markers, and how to access and call object methods.
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 private properties restrict direct outside access in PHP OOP, and how getters and setters provide controlled access with custom logic, illustrated by a phone number example.
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.
Encapsulation bundles data and the methods that operate on it, restricts direct access, and uses getters and setters to protect an object's internal state in PHP OOP.
Explore inheritance in PHP, where a child class extends a parent to reuse and override methods, promoting code reusability and extensibility.
Explore how inheritance handles constructors in PHP, including automatic parent constructor calls, child overrides, and invoking the parent constructor with parameters in dog and animal examples.
Explore how to override parent methods in PHP inheritance, extend functionality with parent method calls, and prevent changes using the final keyword, with constructor examples.
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.
Define a base contract with abstraction using abstract classes and methods, hide implementations, and enable reusable PHP code across subclasses that share structure but vary behavior and cannot be instantiated.
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 PHP magic methods __call and __callStatic, shown for intercepting non existing or private method calls and handling arguments with friendly messages.
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.
Learn how PHP strict types enforce type declarations, requiring integers for function arguments and raising errors for strings, and compare default versus strict mode behavior.
Explore traits as a mechanism for code reuse in PHP’s single inheritance, learn how to define and use traits across classes, and see a simple example of data creation.
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.
Explore PHP namespaces, the use keyword, and aliasing to manage long namespaced classes, import components, and avoid conflicts, with practical examples and autoloader prep.
Master autoloading in PHP with spl_autoload_register to automatically load class files as needed, organize files by folders, and ensure class names match file names for seamless object creation.
Configure autoloading with spl_autoload_register and namespaces to automatically load classes from multiple folders as they are instantiated, mapping namespaces to directory paths.
Learn to implement PHP autoloading with Composer. Configure composer.json and organize code into source with namespaces for controllers, models, and views, then test autoloading using vendor/autoload.php.
Explore postcourse resources for deeper php and object oriented topics, including advanced parts like static and magic methods, cloning, and exception handling.
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.
learn to build a simple php autoloader from scratch using spl autoload register, a common app namespace prefix, and a base directory to load classes by their relative namespace.
Learn to establish a PDO connection to a MySQL database in PHP using a private static property and a public static connect method, with try-catch error handling.
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 with a prepared statement to set title and content using id in where clause, and add a delete posts function with PDO to remove by id via execute.
Learn to build a PHP object-oriented post management flow by creating a posts controller with store and update methods, building create views, and inserting posts into a database.
Display posts in a PHP object-oriented app by using auto-loaded models and looping through get_all_posts. Render titles with bootstrap and include a create new post button.
Delete posts in a PHP app by fetching the post ID from the query string and calling the post model's delete post method, then redirect to the index.
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.
Build a simple form validation class in PHP under app/core, using a static check_required method to validate required fields like title and content, returning errors for display.
Learn how a router maps parts of a URL to controller actions or views, and build a clean MVC structure with a routes file and view class in PHP.
Create a static view class in PHP that loads view files, uses extract to turn data arrays into variables, and demonstrates passing data to views with home and about examples.
Map http requests to routes using PHP 8 match expression, the server method, and the request URI to route get and post actions and load views.
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.
Implement a delete function in the db layer and a delete posts method that uses the id from the url to securely remove a post with a prepared statement.
Explore method chaining in PHP, calling multiple methods on one object in a single line, with each method returning $this for cleaner, readable code, in builders like eloquent in Laravel.
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.