What you say is very true. PHP is in the same boat that JavaScript is in. Their very severe, yet very inherent, language flaws just cannot be covered up with one library or framework after another.
The only real option is to give up backward compatibility, to then throw out every broken language feature, and to then reimplement them properly. Unfortunately for those two languages, that would involve an awful lot of stuff getting thrown out and reimplemented, which is very likely why it hasn't happened yet.
Given how much core functionality needs to be reworked in both cases, I don't think they can really be saved. There are numerous other better languages out there, and it's easier just to use them instead of trying to salvage PHP or JavaScript.
For example they have now deprecated the dreaded mysql_, pgsql_ interfaces (including mysql_now_escape_the_string_for_real() and the like ;) for accessing the database in favor of PDO.
They will be removed in the future.
Lots of projects still use those.
Just 1 example of PHP dropping backwards compatibility.
It's not quite so bad as you make it out to be.
Deprecation of those awful vendor specific DB extensions is a good start, no doubt. But those are library functions, rather than language features.
Another thing to consider is that PHP developers have a track record of deprecating certain functionality, then a few releases later changing their minds and no longer deprecating it. Some examples of this include is_a, and var in property declarations.
Given how it's still relatively common to see PHP 4.x installations in use today, 10 or more years after they were first released in some cases, merely deprecating some of the broken functionality now won't help much. We'll still see deprecated features in use in 2020, if not well beyond then.
The broken functionality needs to be stripped out completely within a reasonable time frame (well under a year), not merely deprecated and left around for years, if it even stays deprecated. But this involves the PHP community acting responsibly, and going along with these changes for their own good. I don't think we can expect that level of responsibility out of them, unfortunately.
I agree about the need to really strip out the bad stuff, not just deprecating.
Wrt removal of language features:
They seem to be in the process of cleaning up some there as well.
For example in 5.4 they removed safe mode, register globals, magic quotes (and those were really awful).
see: http://php.net/releases/5_4_0.php
I also agree that there is a lot of bad stuff still around.
Look at how slow Python 3 adoption has been. I don't think completely breaking backwards compatibility is a quick thing. The Python folks expected 5 years for Python 3 to become the default version because of the dramatic changes.
I've worked on a number of software systems at several different organizations that have very effectively used Python 3 for years now. I think that Python 3 has been adopted perfectly fine by many other people and organizations, too.
We're just not overly vocal about using it, because it has worked for us with so little pain and so little effort in many cases. It really wasn't much different going from 2.7 to 3.0 or 3.1 than it was going from 2.6 to 2.7, for example.
The only real option is to give up backward compatibility, to then throw out every broken language feature, and to then reimplement them properly. Unfortunately for those two languages, that would involve an awful lot of stuff getting thrown out and reimplemented, which is very likely why it hasn't happened yet.
Given how much core functionality needs to be reworked in both cases, I don't think they can really be saved. There are numerous other better languages out there, and it's easier just to use them instead of trying to salvage PHP or JavaScript.