News for hackers. Stuff that matters.
Re:PHP 8 by danudey on Thursday November 26, 2020 @02:51PM (#25223038)
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.
Re:PHP 8 by Denvercoder9 on Thursday November 26, 2020 @04:04PM (#25223514)
Or just make sure you pass the correct type to the functions. It's easier and probably more correct as well.
Re:PHP 8 by zaarn on Friday November 27, 2020 @01:57AM (#25226149)
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.