I notice that when I define a method as abstract, the signature of the child classes must be compatible with it. This makes it impossible for me to use type checking in the signature of the child class.
If I define the parent method as a specific method with a default implementation, I can then override the parent method without respecting its interface.
In cases where there is a suitable default implementation, I tend to use the second approach. But can I hurt myself?
It seems strange to me that using βabstractβ can be so restrictive, so I want to know if something is missing ...
Note. I see that similar questions are asked regarding other languages, but not so much PHP.
source
share