Phalcon PHP: What is it and Why Should I Care?

Phalcon PHP is “the next big thing” in PHP frameworks, going up against the big boys like Symphony, Laravel and Zend, and out performing. Impossible you say! Well the makers of Phalcon did “cheat” a bit.

What executes faster than PHP? C seems to be pretty fast.

That’s exactly what the Phalcon PHP team has done. They have created a really densely-featured framework and written the entire source in C and packaged it as a PHP extension. If you’ve worked with Laravel or a few other pure PHP frameworks, you’ve probably come across an extension called Mcrypt. It is written in C to make encryption a relatively inexpensive process in CPU time. Phalcon PHP takes this one step further by saying, we can save processor time by moving our entire framework to a compiled extension. When we look at the numbers, this technique’s boosted performance becomes readily apparent.

Performance of Phalcon PHP and other PHP Frameworks

Performance benchmark of Phalcon PHP and other PHP FrameworksNothing comes close to Phalcon PHP

Source: systemsarchitect.net

Pros and Cons of Phalcon PHP

Incredible right? According to webcoderpro.com, Code Igniter is the most popular framework of 2013. Although it maintains a respectable place on the chart it does not touch Phalcon PHP.  So why is Phalcon PHP not the most popular frame? There are a few major drawbacks.

Drawbacks of Phalcon PHP

  1. Compiled Extension (complex install, impossible on shared hosting)
  2. Young compared to competition (March 2012)
  3. If something goes really wrong, you’re debugging C

If I’m honest, as I was writing the drawbacks, I came up with ways around all of them:

Solutions to Drawbacks of Phalcon PHP

  1. It’s actually not that hard to install. Don’t use shared hosting. If you’re at a level in your development where you’re using a big framework and are tackling projects larger than a WordPress site, its probably time to check out a better host like Digital Ocean or Rackspace.
  2. For being just under two years old, the community, documentation and maturity of the framework  rival many of the slower frameworks on the graph.
  3. Yes debugging in C for a PHP coder sucks but the community and the help you’ll find on stack overflow will help mitigate this risk.

Let’s sweeten the deal with some pros:

Pros of Phalcon PHP

  1. Fast, blazing fast, really fast, its written in C fast
  2. Traditional MVC code. The PHP part is very similar to other MVC frameworks
  3. Cool factor. It has some of the same coolness of Laravel 4 when it first came out

The Verdict

Phalcon PHP is not perfect for every situation. I’d much rather throw together a quick Laravel instance to mock up a prototype but for a large, performance driven project, hosted on a VPS, I don’t see many reasons to hesitate.