Finding the best PHP framework is hard. Asking for PHP Framework suggestions on a forum gets you nearly as many different opinions as replies. Asking on stackoverflow normally gets the question blocked because it doesn't adhere to their Q&A.
There are so many aspects to take into account when choosing a PHP framework and I think it goes a lot further than how the syntax looks and what feels right.
Wikipedia offers a large tabled comparison of PHP frameworks allowing you to see what features are offered. There are however a few missing and I am not sure if all those green fields should be that colour.
We don't want to have to dabble in a new PHP Framework in six months because a new project has Perfomance as the highest priority and we decided to go with Zend. Maybe we don't want to go with CodeIgniter when it has an insecure future. Maybe the fact that cakephp has no templating engline puts us off, maybe just that fact appeals to us. To that end I think the best way is to setup a matrix listing the points that we feel are most relevant. Your grid may contain a lot more PHP frameworks. The following list had already been hit by the best PHP framework equivalent of the nerf bat, based on general performance.
Best PHP Framework based upon Performance
- CakePHP / Liquify
I can hear lots of calls of cake and performance but I left it in as I have used it in the past for a large project and it scaled well. This would speed up development.
How to choose the best PHP framework
My criteria when choosing the best PHP framework for me was based on the following:
What do I want out of the framework?
Generally I want it to be fast and functional. As long as I can include a class from phpclasses.org, or have some other way of including third-party code and get things working quickly I only really need the following to do the bulk of heavy lifting:
PHP Framework Functionality
- Caching: All PHP frameworks have various caching capabilities so this isn't going to help with my decision.
- Form validation / generation: This is one of the biggy's. I want the ability to generate forms automatically and be able to implement validation for 90% of my fields whilst still half asleep 😉
- Unit testing: I want to be able to use PHPUnit to automate app testing but may look at alternatives if the rest of the framework is godlike.
- Session Management: What session features does the framework bring with it?
- ACL: Some type of user management / access control out of the box is a must. Fortunately most offer just that.
- Templating: Smarty, Twig, which template engine do I want? Do I even need one and if so what is the performance price I have to pay to avoid lots of php tags in my view?
Just because the frameworks in our shortlist have (nearly) all the above functionality out of the box, there are a few other points we should take into account if we want a long and happy relationship with our framework.
- Age: I'm not sure how you feel about this point, but I want my new framework to be too young. I also don't want it to still be supporting PHP4 so a happy medium needs to be found.
- Documentation: We all know how important good documentation is. It will allow to get so much more out of the framework, save us time and stop us swearing quite so often.
- Community: When you are dabbling in your new framework prior to the final decision, take some time to look at the community. Active and friendly communities are a game winner.
- Pros and Cons: These are the points that don't fit in somewhere else, but will influence your decision either positively or negatively. This could be the fact that a framework still supports an old version of PHP, maybe they don't have a dedicated forum etc.
These are the points that I use to help when deciding which is the best PHP framework for me. I look forward to hearing what criteria you use to help youmake a decision