Is Phalcon the promised land for PHP?

Have you heard yet about the full stack PHP framework called Phalcon? It’s written in C, it’s super fast, well documented and it brings lots of freshness into the PHP world. It has been around for awhile now but for some reason it’s been under my radar until now. Why is it so special? If you allow me I will here attempt to prove that this framework has a potential to change the game.

I’ve done a quick research and the PHP community remains silent on this subject. There is only one post on dzone.com and two on phpdeveloper.org. One of them was written by Anthony Ferrara which in fact is a criticism of C based frameworks. Anthony is a very popular and respected PHP blogger. Perhaps his opinion was enough to put down any initial excitement about the Phalcon.

Although I understand Anthony’s points I respectfully don’t agree with them. Currently I’m facing quite a big issue with the performance of ZF1 and PropelORM frameworks. Both are heavily abstracted and there is lots of inheritance in place. One request includes almost 300 files. Only 25% of those files are our code. Even if a controller is empty it takes significant time to handle a request (APC in installed and there is no I/O). This is a major concern to our business and we have some solutions in place to mitigate it.

It is common knowledge within the community that a vast majority of PHP application will never work under high traffic. However it is not only about requests per second but also user experience. According to Google (as mentioned in: “In The Plex: How Google Thinks, Works and Shapes Our Lives”) there is a correlation between load time and consumed content. Users will do more if they have to wait less. Google is very religious about making their service faster so why we all shouldn’t be?

While discussing Phalcon it’s easy to forget that performance is not the only feature. Phalcon is a full stack framework and can do a lot. It offers things like: ORM, query language, template engine, micro application front controller or very handy devtools. It’s all wrapped in a rich documentation with good examples.

The biggest problem I can see with C based frameworks is that there is no direct access to the source code. I completely agree with Anthony on this point. You can’t document everything and you won’t find all answers on Google. There will be situations when one have to debug something. It doesn’t happen often but once it happens it might be a dead end. If looking into a code written in C gives you a cold sweat perhaps Phalcon is not the best option for you. The good news is that, Phalcon’s source is well maintained. The file structure is intuitive and code is readable. Even a basic C knowledge should be enough to debug most of the potential issues.

We all know that PHP programmers don’t have a good PR. Things like Phalcon might cast a new light on the community and the language. For me it’s a step forward but Phalcon is going to have hard time. There are many strong PHP frameworks on the market. Many bloggers, speakers and lead developers invested lots of time in them. Suddenly there is a new kind on the block which makes those frameworks look little bit well… outdated. Things like this will always generate some emotions and programmers are emotional beings.