PHP may have some advantages in terms of deployment, so I guess it's a question of whether those advantages outweigh the potential advantages of using Python for development, which is of course subjective/situational.
I think you miss out if you feel that this is a win when doing PHP.
Partially not kidding - I've used this as far back as 2004 to build cron jobs that pull a dataset, split it into N subsets, then fork out into N children to process those subsets of data in parallel. It's certainly not fluid like tasks and it creates a lot of memory duplication if you fork AFTER your data is pulled, but it works surprisingly well. Parent thread can wait for children to finish and even message children through socket pairs (or pcntl_signal for very basic stuff). I agree that it would be nice to have a native abstraction for tasks with messaging and concurrency limits built in.
A quick test got me 50k req/s HTTP "hello world" on my laptop.
The madlad even managed to place PHP in top 22 TechEmpower benchmark: https://i.imgur.com/6fKUpbV.png
PHP/Go/C# one-thread-per-HTTP-request also requires less cognitive load where everything is synchronous by default. Also PHP's throw-away-everything after each request tolerates much more junior-code abuse.
Forgot to close a database connection or transaction? No problem, PHP will do that for you. Left a file open? Forgot to close a CURL handle? No worriers the janitor is coming to clean your mess at the end of the request.
With that said, PHP does have an event loop. See ReactPHP and Swoole. They existed for years and while they have their uses, they aren't going to overtake "standard" PHP execution model anytime soon partly because of the reasons above.
For example, if you have a long-running database query, disk I/O, or some other blocking function, you can't simply send it to the background and do something else while waiting for the result. Network requests are better, but only because the underlying functions support a rudimentary form of async calling.
https://www.reddit.com/r/PHP/comments/u80gyg/true_coroutines...
I’ve been hearing this for ~20 years, and yet somehow I still find it more painful to use than other languages that didn’t even exist 10 years ago…
(Except for “being easy to deploy on any random bargain-basement shared web host”, which is a hugely important factor where PHP is genuinely best-in-class and no other language even seems to care about competing, and is the reason that I still regularly need to use it)
A few of these things have been fixed, but by and large the situation has remained unchanged for a long time. It's not an easy problem due to compatibility reasons; adding new language features and such is comparatively easy.
Disturbingly for us language geeks, it doesn't seem to matter at all that they're not very good.