PHP: Symfony vs. Zend

This article was published on 27 November 2007. It references a release candidate version of Zend Framework, version 1.0 of Symfony, a preview version of Doctrine, and a version of Propel that had issues with it’s dependency on Creole. It is severely out of date and has not been updated.

The Symfony and Zend frameworks are so amazingly different that they almost don’t deserve to share the title “framework.”

Like the .Net Framework, Zend is a bucket of functions that, together, provide advanced interfaces to the most complex of tasks that web developers need to write regularly. They then leave the developer to work up a quick interface to the application, which they enable with their views structure. Zend’s major strength and weakness is that there isn’t one particular way to do things and that you can pick and choose which libraries you want to use.

Both frameworks are PHP5-native frameworks and won’t function in PHP4. Both are heavily object-oriented and make use of inheritance that’s only offered in PHP>5. Both use the front controller model.

The similarities end there.

Zend uses very little code generation and configuration is all in the front controller; Symfony has a great deal of code generation and a huge amount of configuration overhead. Zend is flexible about it’s directory hierarchy and allows you to heavily customize your directories to use global code libraries; Symfony has a required directory structure that is created when you use the command line tool to create modules. Zend doesn’t require command-line creation of modules.

After the jump, I’ll focus on a few areas where there’s some specific differences.

Getting Started

Symfony has a lot of ‘buzz’ and user support, and there are excellent guides from both the authors and the communities to get users started on the learning curve. Zend doesn’t have as much, and the documentation is really directed at more experienced developers who are old hands with the more complex aspects of object-orientation.

Learn the Zend Framework:
“,21,’date’,’DESC’); ?>

Unit Testing

Symfony provides command-line tasks for unit testing and automatically generates a default (empty) testing object for you when you create a module.

Zend doesn’t have integrated support for unit testing, but all components that go into the framework require unit tests.


Zend’s templating is immature and doesn’t allow easy nesting without a well-documented hack or two, but will in the next release… or ‘Soon ™’.

Symfony’s templating is extremely mature and uses caching extensively to rapidly deliver content to users. You can plug components and entire other modules into slots in your symfony templates, and you can customize the templates as much as you want through the use of layout scripts.


Symfony has an extensive plugin and extension community in it’s community wiki. Zend, as yet, does not. It’s interesting to note that you can pull in the Zend framework’s functionality with Symfony by using the Zend Framework plugin for Symfony.

Database Modules

Zend uses the ActiveRecord model for databases. Symfony allows the user to plug in whatever database manager they want, including Zend_Db.

My issues with Symfony’s two current frontrunning database plugins (propel and doctrine) include the extensive bugs in both (Propel’s issues depend greatly on the lag in changing from Creole to DBO and also the stupidly complex criteron objects, and Doctrine’s as of yet an immature project that recently saw it’s first 1.0 release.) and the code generation / configuration overhead that you end up with when you’re creating hundreds of tables and managing changes to those tables. It gets to be a headache once you get past twenty or thirty tables. Zend’s active record implementation is much easier because all you need to do is direct an object at the item.


By far, Symfony is more complete, mature … but it can be overbearing when all you want to do is develop an application. It’s certainly more feature complete and allows you to be a better developer in a group. It’s the ideal framework to work with when you are working with a group of developers because everyone knows where to find everything. I love certain features like the Ajax integration, but I hate other things like the code generation and configuration overhead of (and the tendency towards serious bugs in) the Propel and Doctrine database plugins. Symfony 1.1 should be very nice and I’m eagerly awaiting it.

My personal preference though is for the Zend framework. Why? It’s more in line with the original goal of PHP — create a loose structure that’s easy for people to get into and develop in, and where you aren’t required to learn a large number of arcane commands and structures unless you set them up. The front controller setup for Zend isn’t very well explained, but it’s absurdly simple once you get into developing modules and functionality. I like the flatter file system. I like the choices I have in working with the views. I think the Zend Framework is easier to train people on and it’s easier to split roles into DBA and Coder roles due to ActiveRecord, but since you have more flexibility in how you set up your application you can’t necessarily bring in a developer that knows Zend and have them find their way around immediately.

There’s tradeoffs to each, so select which one is better for your purposes. It’s great that we’ve got such a wide selection of tools!


This article was published on 27 November 2007. It references a release candidate version of Zend Framework, version 1.0 of Symfony, a preview version of Doctrine, and a version of Propel that had issues with it’s dependency on Creole. It is severely out of date and has not been updated.

33 thoughts on “PHP: Symfony vs. Zend

  1. Sebastian says:

    Where are the severe Propel and Doctrine bugs, can’t you reference them at least?

    And thank you for the link to the PHP6 book, I’ll prefer “MySQS 6.0 – The complete reference”


  2. Hmm says:

    Well I think that this ‘I hate other things like the code generation’ statement deserves #1 on ;-)

  3. Please feel free to disagree with me but Zend framework does not limit you with Zend_Db. Zend_Db is a database abstraction layer provided in Zend Framework but you are not forced to use it. If you want you can choose to use Doctrine or any other DAL lib

  4. pcdinh – No, I definitely agree. That’s the wonderful thing about Zend vs. Symfony — with Symfony, you need to integrate the ORM logic via a plugin and code generation. With Zend, you don’t have to use a database abstraction layer at all if you don’t want to.

  5. Ovidiu C. says:

    ZF is an mvC framework.The models and the views are kinda useless and you end up doing everything in the controller. Of course, you can write some more code to tie things together, but then, what’s the use of having a framework in the first place? You could have done the same thing starting with just plain PHP. Don’t get me wrong, the ZF components are really nice, and they would probably go very well in conjunction with another framework, but they’re like… well, like PEAR with some controller components thrown in.

  6. Wow this has got to be the worst framework comparison i have read to date!

    Forgotten headings:
    Framework overhead
    Code complexity
    Code performance

    Don’t mention that even though zend’s templating is pretty simple its also blindingly fast and still encapsulates the variables so as not to pollute the global namespace, dont include that if you use Zend_DB_Table you have to build a class per table… come on, put some effort into this

    As for propel bugs, huh? where? no quoted identifier support is a known issue… what else is broken? propel 1.3 is quite stable aside from php being a buggy language of late…

    I’m far from a symfony supporter but come on. + + if you want something lightweight and powerful and can still be fast as hell if you use your head about how you do things!

  7. nice comparison. straight to the point and it answered most of my questions between the two frameworks. i was going to use symfony but the setup discouraged me. i tried ZF, then it worked like a charm. and the people in #zftalk (freenode) are very helpful…

  8. “Zend uses the ActiveRecord model for databases.”

    Wrong. Zend uses the Table and Row Data Gateway patterns. ActiveRecord is *not* implementable in PHP until we get late static binding.

  9. “It’s more in line with the original goal of PHP”

    The original goal of PHP and the right tool for the “enterprise” job aren’t necessarily the same thing.

    I don’t think one is particularly better than the other. (That said, I’ve never used ZF for a “real” project, and I’m a symfony evangelist).

    I think people need to realise these two tools are for two different jobs. You don’t *need* to stick to one and shun the other. If I had a need to be a helluva lot more flexible than symfony lets me be (which is *very* flexible), then I’d use tools like ZF.

    My biggest gripe is that people ignore _all_ tools like this and reinvent the wheel themselves. This approach is often frought with all sorts of problems, and usually very unnecessary.

    I like that I can pull in ZF bits and pieces as I need to on projects – for example, using Zend_Search_Lucene inside of my symfony app = bliss.

    Viva la PHP!

  10. I never used Zend and I used Symfony for 6+ months. Before choosing Symfony, I evaluated CakePHP and some other minor framework which might no longer exists (I forgot their names).

    I choose Symfony and I do not regret it. I am currently not working on a Symfony project and I wish I was. It’s the framework that was the most flexible, even with it’s restrictions. I like the fact that it restrict the directory structure. It is true that the learning curve is higher with Symfony, but I continue to think it is worth it.

    I did not have much trouble with Propel, maybe because I am not a SQL expert and was not trying to use SQL to it’s full capacity.

    I would not consider Zend as “the” mvc framework for any of my personal projects, but would definitely use Zend’s components into Symfony, just like I use PEAR.

    The only reason I would work on project built entirely with Zend Framework is because of the word “Zend” in it. Anyone non technical who knows what Zend is for would think it is “THE” product because it has the Zend name on it. So I would learn the Zend Framework and advertise that on my CV simply for the good reputation attached with “Zend”.

    Don’t get me wrong, I know lots of people worked on Zend Framework and I am convinced it’s good code and I would recommend it just like I recommend PEAR. I am actually glad because this gives me yet another resource to get good component/package for my PHP5 projects. Not all packages has been ported to PHP5 in PEAR so Zend saves the day. :)

    I plan on trying out Zend Framework in the near future.

  11. CruxOp says:

    You don’t have to use an ORM with symfony, even though v. 1.0.x comes bundled with Propel, there’s steps on the wiki that tell you how to completely remove it.

    That said, even if you don’t remove it… you don’t have to use it. Simply don’t use the propel schema, don’t generate a model. Symfony will run fine in the absence of an ORM. The only things that depend on the ORM are code generators (which you hate) and Plugins.

  12. First off, I’ll get the disclaimer out of the way- I’m the project lead for Zend Framework here at Zend. Nice comparison! The characterization of ZF is accurate (well, except for the ActiveRecord part, which Geoffrey pointed out already ;)). I just wanted to mention that we’ll have many features, including advanced forms support and a ‘use-at-will’ CLI tool in 1.5 (soon to be released). You might want to revisit this comparison at that time. And if you want more ORM functionality with ZF, this project has just come to my attention: It’s built on top of ZF and adds an ORM component, amoung others.

    Thanks for the kind words in the conclusion!

  13. Hmm… something from me about SF and ZF.
    They are both excellent. The only thing is how u look on them. If you need something rapidly, if you don’t care about application layout nor how things are working than use SF. You will end up with big project in just a second. From the other hand if you want total customized application use ZF. The only problem ( I consider this very good because a lot of “developers” use rapid frameworks and they don’t know a sh**. Tell them to write for example MVC and they will not know from where to start. ) with ZF is that you need to know A LOT about php to use it properly ( and build few things before actually start to do rapid appz. ). So if u don’t have a lot experience with php, if u don’t know what stands for OOP and MVC than go and use SF or any other framework. Don’t even think to start with ZF if you want to finish project in a blink of an eye :). It will be quite easier to catch that “concepts” but from other hand if u do it over ZF noone will know ur application layout ( if no Z_C integrated ). How someone said ZF don’t have real MVC it’s more Controller with MV light-support which makes it even easier to catch ( personally i don’t like Zend_Controller. I wrote my own based upon ZF and similar to SF ). As well I think that it’s generally bad idea to compare ZF with SF. They are completely different except php syntax :D. For those who says bad things about this 2 frameworks well people don’t be as*hol**. Build ur own framework. They all give a lot of effort to make our life easier. “Framework” like idea cannot be finished. It will always be buggy no matter how much people spend time on it. ZF got a hell of a lot bugs. Controller, well I can only say that it can be written a hell of a lot better, Layout as well. SF u can’t customize ( i hate when someone restrict something. ). Application directory can be better but who knows. I like it on that way. Someone else like it on some other way. That’s normal n get use to it :). SF vs. ZF = throw new Exception ( “non-comparable” ) :D

  14. I’m trying to work with ZF but I found it too hard to learn quick, always I use new things by using them in a real project, but this time it take a long time for me and I didn’t do any thing!!!
    maybe I gets old!!!
    I think its manual is the problem I cannot found things I looking for fast.
    Anyway I continue to learn it well.

  15. We at QBurst have used both Zend, Symfony, CakePHP too and I would recommend Symfony anyday. It’s mature, is a real MVC framework, has good documentation and there is a lot of community support. In contrast, Zend has a lot more way to go to mature itself as a real MVC framework. True, it provides lot of libraries, but those are mostly object-oriented wrappers over existing methods – not really useful.

  16. I want to point that the symfony directory structure is customizable, just check the chapter 19 of the symfony book. As was pointed in the comments, the ORM is not a must, you can use plain old queries or whatever layer you want with symfony.

    With frameworks people tend to forget that the code is just plain old PHP so a mysql_select_db() will always work :)

    I will also like that the author point out the Propel bugs or at least updates this post.

  17. Eno says:

    I call ZF the “unframework” because it’s really a bunch of components. We used to call those libraries in the old days but now everything is a “framework” right? :-)

    Glad someone pointed out that everything about SF is customizable, including the directory structure and use of ORM.

    Don’t know why you chose to compare with SF 1.0 when 1.1 has been out for ages. And now 1.2 is out. Its significant because 1.2 comes with Propel 1.3 via a plugin, AND also comes with Doctrine 1.0 via a plugin too (pick one or use both). This also means the ORM layer is now just a plugin (and so can be replaced or ignored). Doctrine has some nice features like schema migrations.

    I also wanted to point out that 1.2 has been re-factored and de-coupled enough to be used as a bunch of separate components if you want, just like ZU.

    Finally, it couldn’t hurt to mention some of the large sites running symfony Yahoo Bookmarks Delicious :-)

  18. I don’t think it can be stressed enough, if you have more than one project to maintain with any amount of code being shared, a framework like SF with a mature CLI is the way forward. Being “forced”, or perhaps better to say “suggested” to do things all one way is a huge advantage when it comes to maintenance. Plus, when new developers come on board their learning curve is greatly reduced. Which framework to use will always be personal preference. But knowing what you can and can’t do with a framework and how that impacts your requirements should always be the deciding factor.

  19. Well, in my experience working with MyMzone I have seen that Symfony is a very mature MVC platform. I will recommend it for any start-up company looking to adopt a framework.

Comments are closed.