In general it's not. That said, when you're picking a language/platform, you should start from questions like: "what are the hard problems?", "what are the lowest effort/most sustainable tools for dealing with those problems?", and "what are the tools that the developers have experience using?"
If your whole team are PHP or Rails veterans and you need to get a complex app off the ground fast, now might not be the best time to switch to Python or JavaScript for the server.
As an example, there's a huge ecosystem for Wordpress (PHP), and if it's not a tech company, piggybacking on Wordpress rather than spinning up a new Node.js based stack might be the most long term maintainable choice.
The hatred against PHP seems to be coming from the people that only know the old days of the language and haven't checked it recently. I'd say PHP is quite relevant for any kind of web-apps these days; the language has evolved greatly in many fields, you have a huge community and there are tons of libraries to get anything done. Especially with Laravel, you can get a fully-functioning web application with a full auth flow in a few minutes.
There are places where you might want to think twice about using PHP; especially with cloud-native stuff, I see that there are many libraries that do not really consider supporting PHP, which might make it troublesome sometimes depending on the environment you will use it. However, if there is a need to develop a web app as quickly as possible, I have personally never seen anything beat PHP.
As someone who maintains an extension for PHP, I hate it because the Zend C APIs are an undocumented dumpster fire, and PHP's basic data structure, zend_hash, is a weird hash type with a str/int union key type and an awkward API.
I also hate it because I hit more memory issues (double free, unitialized reads, etc.) in the language and core libs with PHP than any other high level language I'm maintaining similar extensions for.
Python is great, but I think the answer to "develop a web app as quickly as possible" is just going to be whatever the developer has been using and is comfortable with.
A .NET developer might be able to throw up a webapp quicker with .NET tooling instead of picking up Python & Django (or PHP & Laravel), for example.
From what I've seen, I wouldn't say that it's the preferred platform. It's popularity is waning, and the trend is moving to newer, shinier technologies - for many good reasons.
On the other hand, a big portion of the web is built on PHP, legacy as well as greenfield projects. The language has continued to evolve, for example, PHP 7 with stricter type checks, syntax sugar, significant performance improvements.
Looking at Stack Overflow's popular technologies survey ¹, PHP is among the classics, along with Java, Ruby, Node.js, C#, Go.. It's not going away any time in the foreseeable future.
There's a market demand that PHP fills. There are a ton of PHP developers around the world to hire from, and it has its strengths (as well as justified criticisms). It's probably the easiest way for companies who have little to no web development experience to get started.
Short answer is no, there's nothing PHP is really suited for anymore where it's a clear and decisive winner in my opinion (which you're free to ignore, but I think I have a pretty reasonable opinion having worked on a team that uses PHP for current API work).
For web backend response handling PHP is perfectly _capable_, but there are lots of alternatives that are capable. That's a pretty low bar nowadays and shouldn't be a deciding factor by itself. If you're in a situation with an existing investment in PHP and with a team of productive people already capable and willing to work with PHP, it's not an outrageous decision to keep using PHP. PHP 7 and beyond brought a lot of things that makes the language pragmatic and performant. If you can pretend PHP was invented whole cloth as PHP 7 in like 2016 and completely ignore any and all content related to it that's more than 3 years old, it's generally ok to work with now. If there's a PHP-based COTS product you merely need to install, configure and run then that's also fine.
But... if you're planning on creating a high quality modern PHP codebase correctly with full type hinting, unit and integration tests, robust CI pipelines, making design decisions that maintain code quality long term, etc, etc, you're not really gaining anything by choosing PHP either and might actually be losing out on something else outside the realm of backend web request serving that might have come easier if you had invested your time elsewhere. I find it hard to play devil's advocate for PHP beyond making generalized statements that could apply to Ruby or Javascript as well.
I would say that PHP is pretty similar to Ruby and Python. It has a messier history and some inconsistent syntax that people like to complain about. On the other hand it has a huge community, a wide selection of web frameworks, a big set of useful built in functions and libraries, an ecosystem of useful services (for example around Symfony and Laravel) and excellent performance for a scripting language. Both the language and the ecosystem is still developing at a good pace.
In addition there are CMS:es like WordPress, Magento and Drupal with huge market shares that can be used for everything from small blogs where you to pick a theme and get a site up in minutes, to large e-commerce sites up to advanced headless backends for large publishing platforms.
It is declining in use, but the way I see it it's only because there are more alternatives nowadays, not because it's not a good option.
Here in The Netherlands I've seen a lot of recent projects using PHP backends (mostly REST) using Laravel or other frameworks. Front-ends are all React/Angular though.
Plenty of companies are building boring new PHP sites on Magento and making money without being SPAs. At least here in the Midwest, I've noticed quite a few non-tech companies moving their SPA sites away from being SPAs because it was the wrong technology choice for what the site does.
I have never even looked at the php site or docs, but I am curious.
In this day and age, is there a subset of Apps that PHP is suited for?