Discover the power of Object-Oriented Programming (OOP) in PHP through practical, easy-to-understand examples. This course guides you from creating simple classes and objects to mastering advanced OOP techniques like encapsulation, getters and setters, and method overriding. Whether you're a beginner or looking to refine your skills, this course offers a comprehensive path to learn OOP in PHP.
Overview
Syllabus
- Lesson 1: Your First Spacecraft Class
- Run to Define Your First Class
- Update Class and Object Names
- Fix the Class Declaration
- Complete the Missing Class Code
- Define and Inspect a Class
- Lesson 2: Powering Up with Attributes and Methods
- Power Up with Attributes and Methods
- Modify the Method
- Fix the Spacecraft Launch Code
- Complete the Spacecraft Class
- Building the Spacecraft Class
- Lesson 3: Managing Visibility with Getters and Setters
- Managing Spacecraft Properties
- Refactor for Secret Code Access
- Fixing Visibility Bugs in PHP
- Managing Access with Getters and Setters
- Create a Secure Spacecraft Class
- Lesson 4: Initializing Objects with Constructors
- Running Constructors in PHP
- Set Default Values in Constructors
- Fix the Spacecraft Constructor
- Add a Constructor to Spacecraft
- Build a Robot Class
- Lesson 5: Expanding Your Fleet with Inheritance
- Understanding Inheritance in PHP
- Preventing Inheritance with final Keyword
- Fix the Inheritance Bug
- Complete the Rocket Class
- Building the CargoShip Class
- Lesson 6: Method Overriding in Child Classes
- Method Overriding in Action
- Prevent Method Overriding in PHP
- Fixing Visibility in Method Overriding
- Add Missing Parts for Shuttle
- Master Method Overriding in PHP