We are able to generate quite good code if we know run-time types of all values
We can't predict possible set of run-time types in real-life apps
In cases, when we expect some certain type, but can't be 100% sure, we have to use PHP compatible data structures for internal representation and it makes resulting code inefficient