I was curious about this rant since I'm maintaning a number of PHP projects and I haven't had any issues with "count".
In the Changelog section of the "count" docs at https://www.php.net/manual/en/function.count.php we find:
> 7.2.0 - count() will now yield a warning on invalid countable types passed to the value parameter.
So in 7.2.0 they started raising a warning in cases where the application was doing a stupid thing (calling count on a non-countable object). Notice that PHP's warnings won't stop execution by default. The expected side-effect here is that you get a warning in the logs and everything keeps working normally. Of course, many development setups halt execution on warnings, but this is a decision that devs make to "force" them to writte better code, not something enforced by PHP itself.
> 8.0.0 - count() will now throw TypeError on invalid countable types passed to the value parameter.
In the next major version, they turned the warning into an error. Pretty understandable way to improve the language I would say. Of course it would've been better if this was an error from the beginning, but given a mistake was made here, this is definitely the best way to correct it I can think of.
I'm sorry it took time for you to fix the legacy apps you've inherited. However, calling this out as an example of bad programming language evolution seems very wrong to me. I for one would LOVE that all languages and libraries in my project's dependency chains where as dilligent as in this example.