PHP is a massive player... despite incoherent implementations, inconsistent name spaces, glaring holes in functionality...
Both of those are popular not because they are the "Best"... but because they are popular. They came out at the right time and got the momentum in the right spots.
Granted... some of that might be my own opinion, but those languages have MASSIVE issues and shortcomings. They aren't at the top because of "demonstrable superiority". They are at the top in spite of the issues.