I think unambiguously janky design choices like this[1] in PHP's early history is what's given it such a bad reputation, while it might be a decent language now such a reputation is hard to shake. I'll be honest the only time I'd reach for PHP over a comparable language with a less chequered history like Python is if I was dealing with a project that was already closely tied up in the PHP ecosystem.
Unfortunately the bad design choices from the past are mostly here to stay - I mean, when you have the thing you want to find (the "needle") as the first parameter in about half of your "find something in something else"-type functions and the "haystack" as the first parameter in the other half, are you really going to break backward compatibility just to make things consistent? Of course not! So PHP will never be my favourite language (although I work with it every day), but it gets the job done, so...
Since you mentioned Python: I would never think of using Python instead of PHP, at least not for a web-based project. Performance-wise PHP is (I think) better thanks to all the work Facebook sponsored, and it has all the "batteries" needed for web development included, so the only reason for choosing Python would be that it's maybe more "elegant".
Clarification: While Facebook sponsored a lot of work it was on their competing HHVM system, which spured other contributors that competed with HHVM (Zend mostly) to invest more in PHP and develop the performance improvements in PHP 7 and 8.
The performance improvements where not directly sponsored by Facebook.
Yeah most of the PHP hate came from old school PHP 3 code co-mingled with HTML 2/3 that didn't take advantages of the simple OOP added. PHP 4 took decent steps but couldn't shake that stigmata. PHP 5 and some good MVC frameworks (written in 4 and 5) made great advances and 7/8 and the spinoffs make the language pretty good for any scripting or web job. These days I prefer JVM based languages but if I needed a quick web task with minimal overhead PHP would still be in the top 3 options.
But some old timers (genX) still today bemoan php as if it had no progress made.
[1] https://www.i-programmer.info/news/98-languages/6758-the-rea...