Welcome to my third object-oriented PHP tutorial! If you haven’t already checked out the first two then you may want to take a look at those first, since this tutorial builds on the previous two:
In this article we’re going to explore the idea of inheritance in object-oriented programming, and how inheritance works in PHP. With inheritance, your objects and classes can become much more powerful and flexible, and you can save a lot of time and effort with your coding.
We’ll look at the following topics in this article:
- The concept of inheritance, and why it’s so useful
- How one PHP class can inherit from another
- How a child class can override some of the functionality of its parent
- Working with final classes and methods
- Using abstract classes, and
- Working with interfaces.
Ready? Let’s get started!