Summary
That brings us to the end of this chapter and the end of Part 1. Let's have a quick reminder of what we have covered in this part and this chapter.
We started with a very quick overview of what object-oriented programming (OOP) actually means, and we clarified this by comparing it with some other programming styles. Next, we looked at some existing frameworks and platforms that you might work with that are written in OO PHP.
Then we had a good explore of how the inheritance model works, touched on how abstract, final classes and methods can be used to allow or prohibit inheritability, and looked at a contrived example of some inheritance-based code.
In contrast to inheritance, we explored composition, building classes using instances of other classes, and trying to keep classes small and tightly focused. More modern PHP tends to favor this approach as it brings multiple benefits in legibility, testability, and flexibility.
We moved then to have a very quick...