It's this bad, because it's been abused to do things for which it has never been intended to in the first place, and has grown into a monstrosity from that point.
Originally Posted by Pajn
The rant you cite, although valid from technical point of view (I agree with technicality behind all its points), like any other of the technically correct rants about PHP, is written by a Real Programmer (tm), with a big extensive experience in the field, and who as an everyday job writes huge million-lines long applications.
From his point of view, he is indeed right, and PHP would be very badly suited for this kind of use. PHP-written big applications, like Facebook or Wikipedia, are more an exception (done for some precise historic or technical reason) than the rule.
But, in the first place, PHP has began its life as a quick tool to put some dynamic content inside a web page. While fire up a huge web application, when you could simply just write a single line of PHP code ?
That how PHP began its life, and that's the extent of how far it should be used.
<p>The current foo is: <?php print $foo; ?></p>
Complaining about PHP's problems, would make as much sense as complaining about the limitation and short commings of shell scripts.
(which share some of PHP problems, including inconsistencies of API, because most of the shell call into system command which have each their own parameter syntax).
The main problem with PHP is not that it's bad language, it's that is *used* as a programming language, whereas it should be for quickly hacking small dynamic stuff like what it was designed for.
It would be akin to creating a complex desktop application with a GUI by using nothing but shell-scripts: It is possible, but that would be a really bad idea.
And in both case, there's only a very limited subset of situation where is would make sense (complex web applications written in PHP only make sense for end-user who only have a "classic" web page service: upload files with FTP and have apache serve them, instead of being able to run a full blown web application on a real full-scale web server.
Complex application written in shell script only make sense, for example, for the first stage of an ".sh" installer, before being able to unpack and run actual binary code).
In both case, after the phase of quick-prototyping, if the project grows, it would be better to switch to a language which scales up. Even if that language is Perl (still very hackish, still oriented toward fast-prototype and small experiments, but at least scales better up than PHP).