The language isn’t perfect but I love working with it, these 8.1 and 8.2 improvements have really made it sweet.
My biggest gripe at the moment is the (very old) behavior of e.g. preg_match() and sort(). You’ve got a small handful of these common functions that operate on their input by reference/in place which is gross. A new version of these would be welcome.
PHP just happens to be good at getting stuff done fast, so it's found all over the place, and thus has a lot of eyeballs on it. The negativity is a byproduct of it's usefulness and staying power - the price of popularity, if you will.
I love PHP, especially with the new event loop based modules that let you do things asynchronously, much like Node or Go.
If you know how to use it well, PHP is awesome, and it's getting better with each release.
PHP opened the door to cheap web dynamic web hosting and in turn you had self-hosted applications like Wordpress. It was a few years later that languages like Java and C# became really attractive for back end work, you also had Ruby, Node, etc.
I wrote a lot of PHP in the early 2000s because that is were the work was, that’s what you could write open source code that people would use in, and it was really straightforward to build apps (like a social network for a secret society) without an ‘ops’ team watching your every move.