Labeling these things as "gotchas" doesn't make them predictable imo.
If predictability means to predict, that standard library will behave nonsensically, then yes, PHP has the one high predictability.
Oh, so you _haven't_ used any of the recent versions of PHP, then. You're just talking shit with no actual recent experience. Gotcha. Well, thanks for your input.
docker run -it php:8.0 bash
# php -a
Interactive shell
substr("abcdef", 3);
// no result
-- Ah right, PHP does things differently than other almost every other language that has a REPL and I have to echo a value, which was just returned, even on the REPL ... php > echo substr("", 3);
-- Silently hiding the error. Idiocy. php > echo substr(null, 3);
-- Silently hiding the error. Idiocy. php > echo substr("abcdef", 3);
def
Who is shit talking now? Are you suggesting, that all this is normal and OK? Nothing is fixed. It's still badly designed and probably will remain shitty like that, until PHP programmers finally realize, that this needs to be properly fixed.EDIT: Of course the docs also do not mention this to happen at all and tell you, that the first argument must be a string. So I guess that means, that in PHP terms, null is a string. Great for type safety!
https://wiki.php.net/rfc/engine_warnings
https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_a...
If you never upgrade, sure. PHP 7 and each minor version in it have deprecated and removed plenty of stuff that was legal in 5.6. PHP 8 is on track to do more of the same. I think the backwards incompatible changes are pretty much all good for the language, but claiming backwards compatibility in PHP is completely wrong.
If you aren't on PHP 8, you aren't supported, and if you're on anything earlier than 7.4, you aren't getting security releases. And the new versions released yearly all have breaking changes, and get three years of security support. It's not 2015 anymore.
Which is more important really? I genuinely don't know the answer to this.