
Door: Thijs Zumbrink
23-02-2017 17:40
In this article I will discuss one of the problems you may run into when depending on PHP's relatively young type system. This problem is type invariance: the inability to change a method's signature when implementing an interface: it must exactly match including the type hints, which is too restrictive for optimal use. In the second half of the article, I give an example based on code in a real library.