3 ms·
It also sounds as though the internal type checking is going to be a large developer load as well. In PHP7, internal functions return null for type mismatches,
by danudey 6y ago
It also sounds as though the internal type checking is going to be a large developer load as well. In PHP7, internal functions return null for type mismatches, and in PHP8, they raise a TypeError. This means going back through every case where they call an internal function and wrapping it with a try/catch for TypeError, in addition to checking for null. That sounds like a pretty significant workload change.
- Denvercoder9 6y agoOr just make sure you pass the correct type to the functions. It's easier and probably more correct as well.
- zaarn 6y agoIf you rely on type labels on your functions and variables, you should rarely require a try/catch to handle type errors for internal functions.