In all the cool geek sites, you hear PHP put down as a matter of course. Its inferiority goes assumed by most of the audience. Every once in a while, you see someone decide to defend it, which leads to a nice old flame war, but that's about it. The irony I find is that few of PHP's defenders really do a good job defending the language. The extreme is this one guy, whose defense of PHP runs: "I like it. It does everything I've ever wanted it to do." Not much of a defense. Leaving Turing Completeness aside, the defense says nothing. Anyone can say that about any number of languages and you could never prove them right or wrong. If PHP can do everything you ever wanted to do, then at least half a dozen other languages can (C#, Java, Perl, Python, Ruby, C++). Why PHP? What you usually find with this kind of defender is that it was a language that they picked up at some point, for some reason and they do not know enough about other programming languages or even PHP itself to be able to give an adequate reason.

The charges against PHP are that it is sloppy, inconsistent, encourages laziness (and not the Larry Wall variety), and lacks some of the cooler features of other languages. Guilty as charged. All of those things are true and have been rehashed many times. As a disclaimer, let me say that I agree with this point of view. For web programming, you are better off with Python than PHP. But, let me play devil's advocate for a moment. If I were going to argue for the use of PHP, what would I say? Well, I would begin by pointing out that PHP is fast. Maybe not out of this world, I funrolled my own loops, and wrote my web framework in assembly fast, but it is fast. PHP is also very easy to deploy. If you set up a Python WSGI application or a Rails application on Phusion Passenger, there is a fair amount to set up in the web server and get running. Not unbearably so, but PHP wins as, in most cases, you copy over the source and you are good to go. There is a ton of library code available and many fine, large applications (obligatory Drupal and WordPress references here) written in PHP. There is an abundance of cheap hosting that has PHP set up by default (Python is starting to gain traction as GoDaddy has started offering Python over CGI in their deluxe Linux packages), which, in many cases is important. Sure, if you are personally developing a large Enterprise application, it seems reasonable to expect someone to be able to configure a server for it. On the other hand, if you are running a small business and just want a CMS to run your web site on, you do not need anything more than cheap, low-level hosting. In this case, the business is not the developer and does not hire the developer, but if you are writing the software and want this small business owner to use it, than there is a definite advantage here. WordPress would probably never have caught on if it were not written in PHP because it would be too much work for a lot of people to set up and too much work for most hosting services to support.

There are some notable, often-cited reasons to use PHP left out. For example, many have argued in PHP's favor because there are many developers which means that it should be easier to fill any new positions in the case of departures (an obvious concern for open source and closed source teams alike). The problem with this argument is that, while it is true that there are a very high number of PHP developers, the problem here is that a very high percentage of them simply are not any good. They picked up a bit of PHP and HTML, but were too lazy to learn enough to be truly excellent developers. The end result is that this is more a problem than it is a solution, because there is a lot more chaff to sift through in the hiring process. It certainly is not obvious that you are better off this way than, say, Lisp. There are few Lisp coders on the market, but, as a rule, they are better coders. The very bottom of the barrel have not even heard of Lisp and, if you try to get them interested, you encounter the Blub phenomenon: they cannot comprehend what a more powerful language would even look like.