I've seen lots great, well structured and performant PHP code - the quality depends on the programmer, as it does for any other language.
The language is bad, but... you can still write great code in a bad language. And you don’t need a good language, or even good code to build a great website. Facebook has made more money with questionable PHP code than any site built with elegant pearl webscripts that I know of. Wikipedia is PHP. So was Digg (RIP). Your users don’t give a darn how good your language or code is so long as it usually works.
So tl;dr, PHP sucks, but I love PHP.
I'm sure it's nostalgia but I think the PHP 4 -> 5 transition was the best era of PHP. Codebases at that time mixed OO and C-ish function based programming in pragmatic and easy to understand ways. That weird shitshow of objects, functions that accept pass by reference or pass by value, request scoped global state, etc was fun and anarchic and, for whatever reason, totally made sense to a self-taught programmer like me at the time.
This is quite hard to fix, as it would break almost everything. So you'd end up with a Python 3 situation. However, as of PHP 8, it's less of an issue. If you can't remember the order for arguments, you can use named arguments <https://3v4l.org/cY1PB> like so:
strpos(needle: "foo", haystack: "foobar")
> It throws errors written in HebrewIf you're referring to T_PAAMAYIM_NEKUDOTAYIM, this is no longer true as of PHP 8: https://3v4l.org/2T8qQ -- the error is just this:
Parse error: syntax error, unexpected token "::", expecting end of file
Internally, the token is still called T_PAAMAYIM_NEKUDOTAYIM, but you can also refer to it by T_DOUBLE_COLON: <https://www.php.net/manual/en/tokens.php> and I suspect eventually they'll phase out the Hebrew spelling.It's a talk by the creator of PHP about how PHP grew to what it is today. The entire thing is really interesting.
There is actually a reason for things like 'inconsistent' argument ordering. They're ordered based on the C API, rather than being consistent in user land ;).
Wasn't Amazon originally written in Perl?
The rest of what you say I agree with, but the language was never a performance bottleneck over other scripting languages.
It certainly scaled better than ruby or perl or python apps with the same logic.
The fact that each request was fundamentally stateless and ephemeral helped this if you needed to distribute your app and made development faster as well.
Back to V5 it outperformed its competition in benchmarks
Files are autoloaded lazily, meaning only classes that are touched are loaded on any given request. If the code is split into well sized, purposeful modules, it becomes a non issue.