Summary
That brings us to the end of Chapter 5, so here's a quick recap of what we have covered.
Firstly, we looked at the way objects and classes within an inheritance chain can be regarded as not only themselves but also all of their parents and interfaces.
We then had a look at the way comparison operators work when used with object instances and the difference between identity and equality.
Finally, we looked at the way PHP object variables are actually just references to a single instance and also looked at some different ways you can create a new instance.
In the next chapter, we are going to look at parameter and return types, which is where types gain most of their utility. We're also going to get our heads around covariance and contravariance – basically, the rules that define in what way you can tweak the parameter and return types when you are implementing or overriding methods from interfaces or parent classes, respectively.