Over the past few years the PHP community has matured and evolved immensely The language itself has seen some amazing new features over the past few releases. We now have array literals ($names = ['andrew', 'tom', 'steve'];), function array dereferencing ($first_name = explode(' ', $name)[0];), anonymous functions, closures and traits (similar to mixins). There is composer a package manager similar to npm or bundler and a huge repository Packagist to go along with it.
Although my focus has been on Ruby on Rails and Node.js recently I still use PHP in my day to day work. For the last 5 years CakePHP has been my framework of choice but with the crop of new frameworks emerging I decided I would do some research and see what else is out there.
It seems like Laravel is getting a lot of recognition these days as it rightfully should. It utilizes most of PHP's new features, has amazing documentation, a budding community and a consistent API. All of these features are great but at the end of the day it's not that different from CakePHP which I've already invested over 5 years learning (mastering). The same goes for a bunch of the new frameworks that have either been updated (Symfony 2, Zend Framework 2) or emerged on the scene (Fuel).
Along comes Phalcon
Phalcon is similar in the sense that it is a PHP MVC framework, but what sets it apart is that it's a PHP extension written in C. This has a lot of advantages.
Speed
In benchmarks it is shown to be an order of magnitude faster than most popular PHP frameworks out today. This makes sense, since the code is compiled for your system and doesn't have to be interpreted at runtime.
Forget about framework files
Another amazing feature is that all the classes and functions are available to you anytime anywhere. No need to download a 40MB framework every time you want to start up a new project. All of the components are loosely coupled so if you want to write a simple script that just uses Phalcon's ORM classes, just call them like you would any other php functions. No need for includes and managing files.
Installation
Installation was a breeze on my MacBook Air. Initially I tried installing via homebrew but that was giving me problems. I ended up following the instructions on their website, restarted my server and away I went.
Creating the extension:
git clone git://github.com/phalcon/cphalcon.git cd cphalcon/build sudo ./installAdd extension to your php.ini
extension=phalcon.soRestart the webserver
http://docs.phalconphp.com/en/0.7.0/reference/install.html
Caveats
This won't work on most shared hosting accounts since this has to be installed usually at a root level although I wouldn't be surprised if some hosts started adding it to their default installations in the future.
What's next
I plan on writing a few more posts on Phalcon in the next week. Next up will be setting Phalcon up on Heroku. Stay tuned!