Hacker News new | ask | show | jobs
by danudey 2038 days 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.
2 comments

Or just make sure you pass the correct type to the functions. It's easier and probably more correct as well.
If you rely on type labels on your functions and variables, you should rarely require a try/catch to handle type errors for internal functions.