Maintaining PHP apps can be a pain and the language isn't the prettiest to work with.
However, PHP has created a world where millions of people can create basic web applications, which has led to the creation of tens of millions of new sites and applications, some of those which have changed the world.
PHP has allowed more people to code, which has allowed the world to test many more ideas, many of which have created tremendous value that I think far outweigh the costs.
- A world that has PHP and enabled web developers.
- A world without PHP in which only Java EE-enabled engineers can write webapps.
I think that's a demonstrably false assessment. A language as poorly designed and implemented as PHP isn't necessary to be accessible to "millions of people" -- in fact, does the opposite in enabling them to make serious and expensive mistakes.
Yet the fact of the matter is that's how the cards fell - we had the well-designed, well-implemented languages and frameworks that failed utterly to find any foothold with amateurs and beginners, and only found refuge with the Java EE-enabled engineers.
And then we had PHP.
I'm inclined to side with the parent poster - yes, PHP has a lot of problems when you attempt to make it overly complex, but on the other hand it has introduced many people to programming who would otherwise never have even attempted (or even be able to), and driven ubiquitous web scripting forward single-handedly. Heck, even today, think about someone trying to run a blog - anyone reasonably experienced with a computer can buy hosting and install WordPress with almost no work... try that with anything written in Python?
PHP has a very low barrier to entry, and IMHO a lot of the hate directed at it is frankly jealousy. We are jealous, as professionals, that it is deadly simple to replicate some of our hard work, and that the people doing it are amateurs. This is the same reason people heap hate on VB.
I'm inclined to compare PHP to MySpace - yes, MySpace pages aren't pretty, in fact a lot are downright atrocious. You can make some specious claims about how MySpace-inspired "web design" has made the internet a worse place, somehow, but it would be a pretty thin argument. At the end of the day, both PHP and MySpace opened up a world of possibility to a lot of users who didn't have it before; picking at it really is just being pretentious and elitist.
Yet the fact of the matter is that's how the cards fell - we had the well-designed, well-implemented languages and frameworks that failed utterly to find any foothold with amateurs and beginners, and only found refuge with the Java EE-enabled engineers.
When did we have all that? In 1995, when PHP was started, I remember having Perl, shell scripts, and C server-side CGIs.
I don't recall significantly better viable alternatives becoming available until quite some time later.
I don't think you're looking holistically at the environment of building a dynamic website with no experience at all programming, which is what I think this conversation is about.
If you can, put aside all that you know about language design, frameworks, and software engineering, and try to think from the perspective of a person just wanting to "get something up". Say you want an online store. An online store requires a shopping cart. You ask google how to do this, and google tells you: How to build a shopping cart with PHP. For whatever reason, php was chosen by the internet gods to be the beneficiary of a positive feedback loop: beginners use php, find it easy to use, write tutorials. Tutorials attract google, which means the community is likely to be less of the programmer type (programmers would already know how to do these things in python) and more of hobbyists/internet entreprenuers with little technical skill. Because this community is comprised of less technical people, they are more understanding of the shortcomings of n00bs. They turn away less "stupid" questions, write more tutorials and abstract more of the academic attributes of programming that "make it work". By virtue of attracting so many people, inevitably, there will be some truly capable practitioners that will go on to have success. Derek Sivers of CD Baby fame is one I can think of.
The point i'm really trying to drive home is that the accessibility of a language isn't just about being easy to learn, but about having a welcoming community and environment that helps new users.
Maintaining PHP apps can be a pain and the language isn't the prettiest to work with.
However, PHP has created a world where millions of people can create basic web applications, which has led to the creation of tens of millions of new sites and applications, some of those which have changed the world.
PHP has allowed more people to code, which has allowed the world to test many more ideas, many of which have created tremendous value that I think far outweigh the costs.