Skip to content

Reasons why I don’t hate PHP

PHP is probably the most hated programming language, ever. Yet it is so widely used, easy to write, and easy to deploy that most programmers nowadays have to learn it at some point.

Unless you count pure HTML, PHP is what introduced me to programming world years ago. Back then I didn’t know better, and PHP is so easy to write that I began to commit to it. I did have a few big projects written in PHP (not open-sourced). Not for long, I begin experiencing nightmares of PHP, the first being magic_quotes. I needed to implement a lot of workarounds, but I still use PHP because back then (and even now), many shared hosters only supported PHP. (I just use VPS now, though)

I am not going to repeat what is bad about PHP; you can easily find them over the Internet. But what is so important about this? PHP is changing. There are dependency management modules (Composer), main coding standards (PSR-0/1/2), and even missing features are being implements (Closure, array syntax, etc.).

When I program in PHP, nowadays, I always program in PHP5.4 or later (for compatibility’s sake; I am very tempted to just use pure PHP5.5). These are much better than the old PHP5.2 (which is already worlds better than PHP4). I have my own collection of frameworks I use (basically just some fancy autoloader combined with other frameworks: flightphp, idiorm/paris, redbeanphp, pimple, and mustache). This made PHP programming much better.

PHP is also very fast; while Zend engine is already pretty fast, hhvm (Facebook’s HipHop PHP VM) blew it away.

I am actually still constantly using PHP for new projects since it is very mature, and I am most familiar with it. But Python and Node.js are also very good choices (Ruby is no-go because its performance sucks).