Maybe the issue in your example isn't related to "how bad PHP is" but is to "how bad the code you're referring to is". Never had those kind of issues and yes obviously you've to know what extensions an application is using, but once again, modern PHP applications usually use composer as dependency manager and will gave those specified inside the project.
Good on you to not have to maintain legacy code (15years+).
Also, as a comparison, with JAVA, I have a legacy JAVA 1.5 to maintain, as far as you have the runtime, that stuff works, and that's it. This is how it should be.
Maybe the issue in your example isn't related to "how bad PHP is" but is to "how bad the code you're referring to is". Never had those kind of issues and yes obviously you've to know what extensions an application is using, but once again, modern PHP applications usually use composer as dependency manager and will gave those specified inside the project.
Good on you to not have to maintain legacy code (15years+). Also, as a comparison, with JAVA, I have a legacy JAVA 1.5 to maintain, as far as you have the runtime, that stuff works, and that's it. This is how it should be.
I do, the difference is that, unlike Ruby code bases, it happens to be supported languages that evolved and perform better today.