PHP is not a comp-sci guru language. It's an engineer's language.
1. It's easy
2. It's powerful
3. It's fast enough for most tasks
Developers moaned about language inconsistencies since about forever, but the fact is that this is not a big problem as some think it is.
Q: Is it find(haystack, needle), or find(needle, haystack)? A: I do not care. I can not remember syntax of all functions in the language anyway, not to mention frameworks, but the online documentation for that function is one click away. And if I'm using an IDE, I get a tooltip to tell me.
I can pick up most php libraries / frameworks out there, plug them in my app, and if I find a problem debug it and patch it in half an hour. This might be true for other languages, but definitely not Java or Perl.
Loose typing is actually a good choice 99% of the time when writing an app. When writing a framework/library it's probably the opposite. But how many developers are writing apps compared to frameworks?
Think about the function validatePassword(string $p1, string $p2) versus validatePassword($username, $password)
. Which one is typesafe? Which one is gonna be abused by the caller?
Heck, even the choice not to have private/protected/public members in classes (for php4) really makes sense in the context of an application. How many times are you going to subclass a class which is specific to the business-logic problem at hand? If you're not going to subclass, all the time you spend thinking about this particular aspect is wasted.
Making the language clean up for yourself at the end of every web page means that things like global variables, generally despised in other languages, are not a bad practice anymore. Purists yell when they see it, but it's only because they have not yet understood the scoping implication of the one-page-one-scrip approach.
Want to hack a bit of script in an html page? super fast.
Want to code purely oop? can be done.
Like lambdas and closure? Can be done too (ok, not the best implementation out there, but still...)
I like my hashes to be as simple as arrays. I rarely mix them up - depending on context (or the value of the variable at hand) I can figure out which one of the two is in use. So my array construct is slower than in any other known language. Thing is, for making websites the page speed is nowadays wasted mostly 1-in frontend rendering of all the js and css, and 2-in the db query or nosql fetch. Array manipulation is gonna be 0.1% of it.