There's a lot of hated towards PHP, and I've have joined you if we were talking about early versions and some of the horrors and awful, unmaintainable 'code' munged with HTML that people used to produce.
But the language has transformed an modernised a lot and I feel it deserves a new look.
It's not a perfect language by any means but modern OO PHP is pretty decent.
Ok, so Wordpress is pretty evil but Drupal is much cleaner and I believe that it underpins most of the UK Gov websites (not that they're much cop, but I doubt that's Drupal's fault), and then big PHP Frameworks like Symphony and Laravel have become immensely popular. They have a wide range of features, excellent testability, tidy structure, a mature toolset, are generally very performant, and they typically do
best practice security straight out of the box.
Personally I'm far more worried about the idea of people using JavaScript to write server side code.
For me, an especially important value of PHP is that it's ubiquitous - pretty much any Linux distro has it available as a native package along with your preferred choice of web server. Likewise, there's a tonne of hosting providers who support it natively. It might not be anywhere near the 'best' language but you can be certain to be able to run it on almost any platform.
I do wish that 'proper' debugging with breakpoints etc were easier however. Xdebug is really fiddly and a massive pain to get working.