PHP Frameworks Review (Zend, CodeIgniter, Kohana, CakePHP)

After answering a question on this matter, I decided to publish a little article on this subject.

Many people find themselves wondering which framework to choose for developing PHP apps. The bottom line is: You don't have to choose - learn them all! I will tell you which to learn first, and why.

The concept of programing in a framework is to have a ready-made set of tools to perform everyday tasks, like handling files, e-mailing, printing/validating forms, inserting JavaScript behavior and handling control flow, among other things. Here is a neat table comparing features in some major FWs:   <-- must see this link!

Every major framework has these basic functionalities integrated, and it is just a matter of learning the syntax (yes, again and again) for using each of them.

So basically, it boils down to how well your choice of framework is documented! Are docs updated frequently?
Do they have examples? Relying on forums for help is not the way to go when you are a beginner - you'll get stuck quite often, and might have to wait up to a couple days to get any help.

So, to the chase...

In my experience learning PHP Frameworks, I have found that, for beginners, the best choice (with all merits included) is CodeIgniter. Besides being feature-filled, fast, lightweight, easy to install/configure and extremely easy to get used to, CI's documentation (the user_guide, which is included in the distributed package) is a handy tool for consulting syntax, and it is rich with useful examples you can simply copy, paste and adapt to your need. Forums and help channels are pretty unnecessary, given the kick-ass docs, but if you do need them, they also rock.

Kohana (a branch off CI)
When you start running into CI's year-old-untackled issues, go to Kohana. Kohana is basically CI leaner, cleaner and optimized. Their documentation is not as good yet, that is why I suggest you start with CI. I have never used Kohana forums or IRC channels (although I'm always in it), because Kohana is very straightforward and simply works.

Zend Framework Definitely the expert's choice
Very flexible, decoupled (which means you can get rid of large chunks of it without breaking it), modular (which means you can add stuff you need into it), and developed by the very people who make PHP. What else can be said? One thing: It can be the fastest of them all. It is not on top of my list because I do not believe it should be the first you should venture into, if you don't have a minimum experience with frameworks.

CakePHP is definitely the most popular one. It is (or was) idealized for people who are starting up, and want to cook up easy apps real fast. My personal experience with it lead me to classify cake as an immature project. The documentation is a real mess, some of it still carries syntax that does not work (being from previous versions). They deprecate stuff and never mention it, you have to figure it out on your own. Also, the hype around it caused the IRC help channel and the forums to fill up with creepy freaks that love to ride on your back if you present yourself as a newbee (this is my own personal experience, I'm sure a lot of people have opposite views). CakePHP is also tremendously inflexible (if forces you to place files in certain places, name them in specific ways and code them as it wishes), highly coupled (erase 1 file, and it breaks) and --the-- slowest of all PHP frameworks, which is why it is last on my list.

I hope this helps, happy coding!

André Tannús - LD @ Diagrama Estúdio.

Comments (3)

Do you have any experience with Yii?

It's currently top of the list of Top 10 Ranking PHP Frameworks and Top 10 Hot PHP Frameworks on
Loganathan NatarajanLAMP Developer

Yes, I too vote for YII as this framework am using in my current project.
Most Valuable Expert 2011
Author of the Year 2014

The "best" framework at any given time is a moving target, as tastes and capabilities change over time.  Today (2014) Laravel is getting a lot of traction from experienced PHP application developers.  It and some others are profiled by SitePoint here:

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.