Article History

PHP sucks

PHP sucks. Face it, it does. How can it be 2006, and PHP 5.1.0 still doesn't have namespaces? Or scoping?

PHP is developed and maintained by people with a “hands off” approach and clearly no idea of where the language is going, let alone where it should be going.

The main points that stick out for me:

But perhaps the biggest reason PHP sucks is that people use it to make large web sites. Do you know what PHP originally stood for? Personal Home Page. It was a simple Perl CGI script to add dynamic elements to simple web pages. And for that it is probably still the best language to learn. But because of its simplicity, people learnt it and it became popular. And because it became popular, the developers extended it with DB functions and the like. And now people have constructed very large and complex web sites using a language that was never meant for large-scale development. That's the biggest problem with PHP. Learn it if you want. Go ahead and use it in your simple home page. But for gods sake, move onto another language and framework if and when you want to make anything bigger.

In comparison to Perl


other languages simply support prepared statements, which sidesteps the entire problem. No escaping necessary, just use a parameterized SQL statement. They also support the standard string concatenation method, but prepared statements are there from the start, and many examples make use of this. Although there is a package for PHP to support parameterized SQL, all the PHP I've seen simply uses string concatenation.