HEY YOU! IT’S 2013 AND THE ARTICLE BELOW IS OUT OF DATE! IF YOU WANT TO FIND OUT WHAT THE BEST PHP FRAMEWORK IS FOR 2013, THEN I ENCOURAGE TO YOU CHECK OUT THIS RECENT BROADCAST FROM MY WEBSITE AT http://www.DCRadioNetwork.com. Cheers! – David
Just in case you haven’t noticed, the PHP community is now split in two – on the one hand we have developers who use normal “out of the box” PHP and on the other hand we have developers who use frameworks. I must confess that I spent rather a long time resisting the whole frameworks scene. However, after a few years of stubborn resistance I was finally persuaded into tuning into the frameworks way of doing things.
A good PHP framework should improve security, make websites easier to upgrade and should also dramatically reduce the time it takes you to build websites and web applications. Personally speaking, I’ve discovered another benefit of using frameworks which is seldom documented. You see, before frameworks appeared on the scene it was a challenge to keep on top of all of the emerging technologies for the web. A good PHP framework, however, should help you to keep on top of everything that’s new and hip in the world of web development – without having to learn a bunch of brand new technologies. Need a PDF generator? Your framework should be able to handle that. How about an RSS feed? No problem! Or, how about one of those fancy auto complete features for a search form? Well, sure enough, there’s frameworks that can produce those too.
The big question that a lot of developers are asking these days is, “What is the best PHP framework?”
Well, that’s a question that’s virtually impossible to answer for two reasons. Firstly, we all (as developers) have different hopes and aspirations for our frameworks. For example, person A might be interested in improving development speed while person B might be more interested in having a framework with lots of advanced features. The second reason why “What’s the best PHP framework?” is virtually impossible to answer is because unless you’ve spent at least six months (in my opinion) really getting your hands dirty with a framework, then you don’t really know it. I dare say that there is not a single PHP developer on the planet who is intimately familiar with every major PHP framework. Therefore, there’s always going to be a bit of speculation when you hear somebody talking about what the best framework is. Sure, we can look at statistics (file size, load speed and so on) but statistics don’t really give us a sense of the feel of a framework.
Never the less, I thought I’d throw my oar in and offer a few thoughts of my own. Perhaps this will help some developer out there to make a more informed decision about which PHP framework to use. I declare openly from the start that I am not intimately familiar with all of the frameworks I’m about to mention. However, I have at least tried them all and have (I think) grasped a sense of what they’re like to work with. So, here’s my top five best PHP frameworks of 2011:
5th Place : CakePHP
If you look at the statistics, CakePHP is one of the slowest PHP frameworks out there. It’s also rather difficult to learn and has a somewhat cumbersome feel. I must confess that I have not spent much time working with CakePHP. However, the time that I did spend working with it was rather uninspiring. The form generation and validation methods, for example, seemed slower and more awkward to me then straight “out of the box” PHP methods, using OOP.
So, you may well ask, “Why has CakePHP made my top five?” The answer is simple. Community.
The CakePHP community is massive and vibrant. Check out the CakePHP “bakery” and you’ll find tonnes of web development goodies – enough to keep you going for a lifetime! Just about everything that I’ve ever wanted to build for a web application has already been built by someone from the Cake community. As far as I can tell, the CakePHP community is ahead of all other frameworks in this regard. So, for this reason alone Cake makes the top five.
Massive, vibrant community
Tonnes of free downloadable sample code and applications
Slow page loads
Difficult to learn
4th Place : FuelPHP
FuelPHP is a new entry in this year’s chart, knocking Kohana off of the fourth spot. Incidentally, Kohana is still good but nobody from the Kohana community can be bothered writing a manual. No manual equals no future. Goodbye Kohana. It’s been fun. Interestingly, I think that in some respects FuelPHP is similar Kohana. Both frameworks are inspired by the Codeigniter framework and have attempted to improve on some of the areas where Codeigniter isn’t so strong. Last year I said that Kohana was basically Codeigniter on steroids. Today the same can be said for FuelPHP. There’s even at least one leading member of the Codeigniter development team helping to build Fuel.
FuelPHP is modular which means you can quickly “bolt” parts onto your applications. The code is also slicker and more compact than with Codeigniter. The framework even has HMVC architecture built in. On paper it has everything going for it!
Personally speaking, I wanted this to be my framework of choice, and I wanted it to be number one on this list, but alas, FuelPHP has a few drawbacks which the makers need to address before it can join the big boys. One drawback is that the actual code that you have to write to build applications with FuelPHP is not as compact or as easy to follow as Codeigniter code. More keystrokes means less efficiency and that’s not good. Another drawback with FuelPHP is that it’s a fairly new framework which means that the community is relatively small. However, that could change in the future.
Personally speaking, I’ve already spoken to some savvy business owners this year who are insisting that their IT developers switch to FuelPHP. One thing is for sure – if Codeigniter undergoes a major rewrite or any kind of majorly negative modification then we’ll surely see a tidal wave of developers switching to Fuel.
Fast page loads
Similar to Codeigniter (which is considered to be one of the easiest frameworks to learn)
Code is less compact than Codeigniter
A serious shortage of books and learning resources
3rd Place : Zend
If we were ranking all of the PHP frameworks in terms of which one gives you the best employment opportunities then Zend would be first, hands down. If we were placing a bet on which framework would have the most longevity then Zend would surely be our safest bet.
Built by the makers of PHP, Zend is currently the PHP framework of choice for big business. Like CakePHP, it comes packed with tonnes of advanced features, plugins and free optional downloads.
Personally speaking, I haven’t spent a great deal of time using Zend. However, I have a close friend who swears by Zend and has used it to build some absolutely fantastic web applications. As far as I can tell, Zend has pretty much everything you could hope to find in a good PHP framework. It’s powerful, fast and scalable. The demand for Zend developers is immense and knowing how to use Zend is like having a guarantee that you’ll never be out of work.
One of the biggest, though seldom discussed, advantages of Zend is on the IDE front. Users of Zend can enjoy all sorts of auto complete functionality (with software packages like Eclipse) that those of us using other frameworks can only dream of.
Sadly, for me, Zend has a couple of drawbacks. One of which is the somewhat commercialised atmosphere that seems to swamp all things Zend. For instance, the moment you visit the Zend homepage they try to sell you stuff. Expensive stuff. Sure, you can go down the freebie road, like most frameworks. However, if you want to take advantage of the best that Zend has to offer then you’d better have deep pockets.
I also find it disturbing and somewhat perplexing how silent and, for want of a better work, dormant the Zend community seems to be. For example, the last time I checked on YouTube there was only a tiny handful of tutorials on the subject of Zend – all of which were conducted by a guy who sounded disturbingly like Borat!
As far as I can tell, the makers of Zend have been dragged into the open source world kicking and screaming. For this reason, in spite of a range of impressive features and specifications, I have Zend in 3rd place.
Zend is currently the PHP framework of choice for big business
Expert Zend developers usually enjoy outstanding employment opportunities
Being built by the guardians of PHP virtually guarantees that Zend is here to stay
Users of Zend can expect to receive a tidal wave of sales pitches from the makers of Zend
Zends users need to purchase (very!) expensive add ons to get the best from Zend
Severe lack of community generated tutorials
2nd Place : Yii
Statistically speaking, Yii is arguably the best framework on the market (at least, at the time of writing). It gives lightning fast page loads and has more features than you could shake a stick at. Yii is a relatively new kid on the block, as far as frameworks go. The main thing that gives Yii such a high ranking, for me, is the sense that Yii represents the next generation of frameworks. In other words, it’s not just a bit faster than Codeigniter or a bit more feature packed than Zend. With Yii we have a genuine attempt, I think, to radically improve and change the way people use PHP frameworks.
If you’ve tried building websites with or without frameworks for more than six months then you’ll have noticed that you spend a lot of time doing the same things over and over again. For example, building authentication systems or top navigation bars. The makers of Yii appear to have spotted some of those areas and discovered brave new ways to negate them. For example, from the moment you install Yii, you get a perfectly functional and rather impressive website up and running – all automatically. Yii also comes with a range of wizards for common tasks like CRUDing (creating, reading, updating and deleting) which will leave you wondering “Why didn’t any of the other framework makers think of this?”
Critics of Yii will tell you that it’s difficult to learn and too strict. However, Yii has a nuclear bomb under its’ sleeve to tackle that objection – a guy called Larry Ullman. Larry Ullman is one of the world’s best selling PHP authors. He has written extensively on the subject of PHP and is famous (or, perhaps I should say “highly regarded”) for making difficult web development concepts easy to understand. Within the past year, Larry has been extremely active within the realms of the Yii website. He has written a fantastic series of articles which are all very clear and easy to follow.
Unfortunately there is, never the less, a shortage of books and documentation on the subject of Yii. However, that may change in the future.
Personally speaking, I don’t use Yii in my day to day job. The reason for this is because I don’t have time to spend three to six months learning all the ins and outs of a new framework. Perhaps that will change in the future. In any event, I have spent some time playing around with Yii and based on what I’ve observed I can definitely say that, if I was starting from scratch, I’d definitely give Yii some serious consideration.
Yii was last year’s winner, when I first published this list. However, I have observed a number of developers complaining that the actual code is messy and difficult to follow. So, for this reason I’ve dropped it down to position two. Never the less, it’s a serious piece of kit as far as PHP frameworks go!
The fastest loading of all the major frameworks
Automatic generation of base code
Being a relatively new framework means lack of books and tutorials
Less employment opportunities than other leading frameworks
Code is not as easy to follow that with other leading frameworks
1st Place : Codeigniter
Codeigniter is currently my framework of choice. It’s relatively easy to learn, delivers lightning fast page loads, has tonnes of advanced features and has a very large and active community. As I write there’s currently around 20,000 members of the Codeigniter discussion forum. That’s 20,000 people who potentially know and want to discuss Codeigniter!
Feature wise, Codeigniter can stand toe to toe with other powerful frameworks such as Zend and Cake. It also, without question, has the best documentation of all the php frameworks. That was a major selling point for me.
Although Codeigniter is built and managed by Ellislab – an unashamedly commercial web development company – everything about Codeigniter appears to have been built in the true spirit of open source. Unlike IBM (the makers of Zend), Ellislab don’t try to hard sell to people who use Codeigniter. Thankfully, they have another product (called Expression Engine) where they like to focus their attention . The actual Codeigniter framework is indeed a 100% free and an open source framework with no catches at all and (unlike Zend) no pre-packaged upsell schemes as standard.
I have intimate knownlege of Codeigniter and I think it’s fantastic. However, it’s not perfect. Firstly, it lacks some of the very powerful functionality of Yii, which slows down development time and makes mistakes more likely. Secondly, to make Codeigniter do the things I want it to do, I need to download and install addons which have been produced by volunteers from the community. So, to make it modular (which I like to do) I need to use a third party HMVC addon. Also, to get it using PHP’s native session functionality I need to download an addon for that too. That’s a problem. The final problem I have with Codeigniter is that the methodologies are so loosely structured that no two developers seem to use Codeigniter in quite the same way. So, everybody seems to have their own way of validating forms, using MVC and basically using the framework, day to day.
Never the less, Codeigniter is a deserving winner – in my opinion. It has a massive community, it can be used to build any kind of application that you might dream of and the code is clear and compact. It just works!
WANT TO LEARN CODEIGNITER? CLICK HERE AND ENJOY MY FREE TRAINING ON MODULAR (HMVC) CODING WITH CODEIGNITER. IT’S ON YOUTUBE AND FREE. (Note: HMVC is a method of using frameworks which is faster, and generally better than MVC)
Fast page loads
Relatively easy to learn
Not as many features as Yii
You need to download third party addons to get the best out of it
Non-strict structural requirements make Codeigniter a coding free-for-all
NOTABLE OMISSION: Keep an eye on Symfony 2. As far as I can tell, Fabien and the gang have been doing some great work with the Symfony framework over the last year. I’m not in a position to offer in depth commentary on Symfony due to lack of experience. However, I think it’s definitely worth a closer look.
Thank you for reading. Rock on!
The Best Top Five PHP Frameworks of 2012:
1st: Codeigniter * UP ONE PLACE *
2nd: Yii * DOWN ONE PLACE *
4th: FuelPHP *NEW ENTRY*
The Top Five PHP Frameworks of 2011