I've been migrating some outdated PHP code to PHP 8.1 and noticed that since PHP 8.0 certain built-in functions will now throw a TypeError exception instead of a mere warning when the arguments passed aren't correctly typed. See here.
I'm quite baffled by the fact I can't seem to find a comprehensive description of this change. The code inspection tools I've ran didn't catch it either, but I can't blame them either, as this is likely a runtime issue. Some sources report all built-in functions have been promoted to throwing TypeErrors, other sources say only some functions are affected. I've already searched through the general PHP changelog for this change and was only able to locate two affected functions, those being array_column() and count(), the latter coincidentally being the one that made me aware of this issue in the codebase I'm migrating. Does this mean only these two functions are affected by the change?
If anyone is able to offer some clarity on this I'd be very grateful.
This change was made by RFC https://wiki.php.net/rfc/consistent_type_errors.
All changes is here https://github.com/php/php-src/pull/3794/files
You can write a parser over PR above to get a list of functions.