If there's room for Javascript, there's room for PHP. Both are sloppy, inferior languages, but both can do anything you need. And unfortunately, both have immense momentum from being first in the web game.
> If there's room for Javascript, there's room for PHP.
PHP doesn't run in the browser. For browser programming there's literally almost no choice. TypeScript seems to be an improvement but even that compiles down to JS. Same for ReasonML and BuckleScript and Elm.
My point is that both PHP and Javascript owe their popularity not due to their merits as languages, but rather to being in the right place at the right time - time and positioning.
Ha, I was going to make a comment along these lines. I didn't mention the languages I enjoy over PHP but I can assure you JavaScript ain't one of them. I don't hate JS but as a server-side language I would pick PHP over it any day.