Why Zend Framework

 Posted by on September 7, 2012  General  Add comments  Tagged with: ,
Sep 072012

Fabien Potencier just wrote an interesting post where he outlines what he believes to be the selling points of the Symfony project. First, let me point out that all of his points are 100% valid, and there’s no doubt that Symfony is a great framework. I have great respect for Fabien and the Symfony project as a whole.

That said, my concern with Fabien’s post is that usually “selling points” for something imply that they are things that set something apart from the alternatives. Now, I’m sure Fabien had no ill-intentions when writing his post, but I do worry that some may misinterpret his post as a list of things that set Symfony apart from Zend Framework or other frameworks, which is simply not true.

Allow me to address each of Fabien’s points from Zend Framework’s perspective:

Symfony is not a framework but a project. Depending on your needs, you can choose to use some of the Symfony Components, the Silex micro-framework, or the full-stack framework.

Zend Framework is, and always has been a component framework (or, by the above definition, a “project”, not a “framework”). You can simply use whichever components you need, or the full stack framework; and yes, there’s even a ZF2 micro-framework if you like buzz-words. With ZF2, we took this use-at-will architecture even further, making each component available via both Pyrus and Composer.

Symfony is used by many large companies (like the BBC or CBS), by many large websites (like TED, wetter.com, Lockers or even YouPorn just to name a few) and some Open-Source projects are also powered by Symfony (CMSes like Drupal or eZpublish, libraries like PHPUnit or Doctrine, products like phpBB or shopware, and even frameworks like PPI or Laravel). This brings a lot of interoperability between all these solutions.

Zend Framework is used by tons of huge companies and websites: BBC, Cisco, Discovery, Panasonic, Offers.com, and more. Additionally many open source projects and frameworks are powered by Zend Framework as well: Magento, TomatoCMS, pimcore, Centurion, Digitalus CMS, Webfolio, PHProjekt, Concrete5, and even the aforementioned PPI framework uses ZF2 in addition to Symfony components!

Symfony enjoys a huge community of users and contributors; during the last year alone, 550+ people contributed to the Symfony core and the community created over 1,600 bundles for the full-stack framework. Symfony also has several annual dedicated conferences around the world and a large number of user groups.

Zend Framework and Symfony both excel in their vibrant communities. Zend Framework has enjoyed as many as 15 million downloads, has several annual conferences, and many user groups around the world.

Symfony has been created in 2005 and here to stay. Besides SensioLabs, many other companies rely on Symfony for their clients and they contribute, invest money, and sponsor the future of the project.

This is all true for Zend Framework as well. Zend Framework was conceived in 2005 and released in early 2006. Besides being backed by Zend, the company behind PHP, Zend Framework has many large technology partners and contributors such as IBM, Microsoft, Google, Rackspace, and more. Zend Framework has been one of the most stable and reliable frameworks in terms of maintaining long-term support, professional services, and backwards compatibility in major versions. Even with the recent release of 2.0, ZF1 will still see official support in the form of maintenance and security fixes for years to come.

Symfony embraces the “don’t reinvent the wheel” philosophy, and provides tight integration with many other Open-Source projects (like Monolog, Assetic, Doctrine, Propel, …).

With the release of ZF2, Zend Framework strives to utilize other libraries where it makes sense to do so, such as using Doctrine\Common for annotation parsing. Additionally ZF2 intentionally does not provide yet another templating language, and instead makes available an incredibly powerful view layer which allows for simple modules such as ZfcTwig. Those who desire ORM functionality are encouraged to use the official ZF2 DoctrineModule, while Zend\Db provides a simpler database abstraction layer with many distinct technical differences and objectives from Doctrine’s DBAL project.

Symfony tries to bring innovation to PHP: it was one of the first major frameworks to embrace PHP 5.3, to introduce the usage of a Dependency Injection container, and to use a templating engine for its templates by default, Twig, which is now also adopted by major CMSes like Drupal and eZpublish. Symfony also has some unique features like its gorgeous debug toolbar and its great built-in profiler.

There’s no question that Zend Framework has always been an innovative PHP framework. ZF2 introduces a truly unique and powerful perspective on modules and modular architecture, follows the SOLID object oriented design principle, makes use of all the new PHP 5.3 features such as namespaces, late static binding, lambda functions, and closures. ZF2 also brings several powerful concepts and patterns such as using hydrators to connect data sources like databases and forms to entities in a clean and simple way without having to resort to a full-blown ORM. If you’re a fan of Symfony’s debug toolbar and profiler, you’ll likely fall in love with the amazing ZendDeveloperTools ZF2 module, or for ZF1 folks, there is ZFDebug, which has been around for years.

In closing, I’d like to re-iterate that Symfony 2 and Zend Framework 2 are both fantastic frameworks with a ton of brilliant people behind them. While Fabien makes some realistic points about things that make Symfony a great framework, he failed to point out that the same can be said about not only Zend Framework, but a handful of other high-quality PHP frameworks as well. Let me be clear that this is not meant to be a Zend Framework vs Symfony post, and as such, I’m not going to include an additional list of selling points that actually do set Zend Framework apart from Symfony. In fact, I encourage challenge you to go spend an hour or so to learn about the opposite framework that you’re comfortable with. If you’re a Zend Framework user, go through the Symfony 2 quick start. If you’re a Symfony user, try out the ZF2 getting started tutorial. I’m not talking about skimming through the guides and passing judgement based on the code snippets; actually download the framework, and go through the guide from start to finish. It may not change your mind or win you a new favorite framework, but you’ll be a better developer as a result.

Update: Fabien has since clarified that his post was not meant to be specifically targeted at Zend Framework, rather all other PHP frameworks in general. Unfortunately, I believe his post to still be relatively misleading, so I will leave my post here to help keep users informed from an alternative perspective. Also, Jose Diaz-Gonzalez has posted a great article on the reasons you might want to pick CakePHP, which is definitely worth a read!

  36 Responses to “Why Zend Framework”

  1. Well said, and when I read Fabien’s post, I thought the same thing. He didn’t really show the differences between the frameworks. Similarities however don’t help us select the best tool for the job. Don’t hold back the differences from us, be proud and tell us the differences and why they’re better in your opinion. That’s why I’ve subscribed to all the major project leader blogs, to know their opinions.

  2. Thanks for the nice post. I’m glad you’re keeping the positive tone. All the discussion (or, rants sometimes) between PHP frameworks underscores the fact that PHP is one of the most vibrant web development communities out there. I mean, it’s amazing that there is so much room for not just Symphony and Zend, but also the other ones that have so much support.

    For my part, I’m looking forward to seeing some big ZF2 implementations this next year…

  3. Well several of the arguments that were put forth in relation to Symfony2 apply to Symfony2, while many of your above points do not apply to Zend Framework 2 but to Zend Framework 1. Obviously its hard to come out with a stable release and have a ton of extensions and high profile use cases to show for. But in fact Symfony2 came out 1 year earlier and did have more extensions available (or at least our Bundles index featured way more Bundles on the date of our stable then I see modules on http://modules.zendframework.com/#modules) on the date of its release. Also with opensky.com, excercise.com and joiz.ch there were multiple large deployments of Symfony2 months before the first stable release even. I am not aware of any large deployments based on ZF2 MVC, but maybe I just didnt hear about them. I have also not heard of any recent adoptions of ZF2 (or ZF1 for that matter) by other projects. So I think your comparison above is partially an apples to oranges comparison.

    That being said, I do expect ZF2 to be able to move a large chunk of the ZF1 user base to it and maintain partnerships with high profile IT companies. I also expect some of the high profile ZF1 apps to make the switch to ZF2.

    On another note, and this of course also applies to Fabien’s post, I would be more interested in more technical comparisons. Afaik ZF2 core features a view layer, which f.e. Symfony2 only provides through the FOSRestBundle which is a 3rd party extension. Also Symfony2 delegates template inheritance to the template engine (and it ships a PHP template engine that supports this, though most people use Twig which also supports this), while ZF2 last time I checked relies on events to decorate templates with layouts. Also ZF2 puts a lot of emphasis on supporting autowiring in the DIC, which Symfony2 again only supports via a 3rd party Bundle.

    I would hope for more technical analysis of the differences. But often time when I ask for this (and I am not implying here that you, let alone this blog post has, are doing this) the answer is “who cares just mix and match” or “competition breeds innovation”. Sure both are true, but I would still like to know where the projects are different and where they are more or less the same.

    • I’d love to sit down and look at it going through “how-to-hello-world-it” perspective. Could be quite interesting to build a detailed comparison.

      I’d also love to find points where the two projects can actually co-operate by swapping pieces, like in a (example) Silex application where you may want to use an EventManager and a DIC container respectively from the two different code bases.

      It is quite clear that the MVC differs too much to be merged, but maybe routing from SF2 (which I really love) may be used also in ZF2 by wrapping it into an adapter and even using the entire Symfony App kernel where needed.

  4. Symfony community created over 1,600 bundles, I don’t see over 1,600 ZF modules?

  5. Great post, simply I prefer Zend Framework thats all. ;)

  6. Great post.

    One question, did anyone tested performance on ZF 2 stable version?

  7. I have already tested the Zend Framework2 and Symfony2 too. I think ZF2 and SF2 are both pretty cool but Symfony2 is better. SF2 is very matured project :-) I prefer Symfony2 :-) .

  8. Both are great frameworks. Period.

    BTW – can we please have simpler process to downloading ZF files? 3 clicks + sign in is a tad troublesome. :)

  9. I think you need to work on the documentation. I had to choose before starting a new project, use ZF2 or SF2.1? But seeing such listings as there and comparing how it is implemented in a SF2.1, the issue was dropped pretty quickly.

  10. Actually, Fabian’s post was disappointing. I wonder why one should call a framework a ‘good’ framework just because BBC is using it?

    Besides, the 1600 or so ‘bundles’ he talks about, try getting them to run, you would end up in frustration with most of them. And I am not even talking about the smaller bundles. Try using the FOSFacebook bundle, and you will know what I mean.

    Fabian was talking like a true businessman, not caring about reality but about ‘sounding too kewl and too freakin smart’.. guess what, Symfony is an attempt to make PHP behave like Java BUT if I wanted THAT, I would just use freakin Java instead of this hack called PHP.

  11. Hey, evan! :) Sorry to ask this question here, but I really need to know… ^^ How can I generate pdf with Zend Framework 2? I can’t find the answer anywere! =S Tanks!

  12. Great post, Evan!

    Yes, all the points mentioned are pretty generic which applies to almost any php framework. I should know, a couple months ago, I was looking for a framework to build a project on. At the end of the day, I went with ZF2. Still walking on the learning curve.

  13. Zend programmer A quality Zend programmer can create a difference to your business requirements with the help of his concepts and skills in creating open source PHP structure based on web 2.0 applications.

  14. I came from ZF1, in whitch was missing events, dependency injection, easy modules and module config merging. So I implemented it. And now ZF2 is out with almost everything I want in ZF1. From my point of view ZF2 has cleaner architecture and don’t force me to use things I dont want, eg. twig, yaml, doctrine … of course there are modules yet. I think SF2 is for less experienced users and ZF2 is for users who want to build on top of it. I think ZF2 has very big potencial. I don’t say SF2 is not good, but ZF2 fit perfect my needs. So thanks.

  15. Hello,

    Can anybody help me to choose among Zend, CodeIgniter and Yii. We have to select ony one of them.

    Regards, Vinay Srivastava

    • Hi Vinay,

      To make an informed decision on which framework to use, you really need to look at the requirements of your project and the features available in each framework to see which one meets your needs best. There’s no easy answer as to which framework is “best”, unfortunately. You should also consider the skill level of your team and which framework those developers will be most productive in.

      Best of luck!

    • zend framework2 dear

  16. Evan,

    thanks for providing a well balanced article both in technical content and in writing style. Thanks also for showing a series of the equally positive merits of the Zend Framework. It’s both heartening and encouraging to see this style of constructive discussions, where both sides are given the coverage that they deserve.


  17. I am J2EE and PHP Developer . I really think zend have better documentation in compared with symfony . but both of these only copy technologies from j2ee (ORM [hibernate] , DI [spring] , phing [ant] , composer[Ivy] , ….. ) . there is not any creative idea . but symfony in version 2 copy some techs faster than of zend . php never will be a Enterprise solution in competition with java . php should stay FAST and EASY . (in fact now java is faster than php because servlet containers)

  18. Thanks for hat article. Actually i am comparing symfony and zend for a project at work.

  19. ZendDeveloperTools is a joke. They offer only a fraction of the function what the Symfony toolbar offers.

  20. I wouldn’t choose a framework based on a developer tool. Symfony’s toolbar offers a fraction of what xdebug/kcachegrind offers, which are framework agnostic. A lot of what the toolbar in symfony has is a facade. For example, their ‘profiler’ does not profile your code. It only profiles the core symfony code. What use is that? All I really look for in a debug toolbar is the total time to render the page, and some break down of what portion of that is database queries, and what those queries are. ZF’s toolbar does just that. Just need to be able to see relative page load times.. compare today’s load times to last week, etc.. You’re still always going to need 3rd party tools to debug.

  21. Zend framework2 structure is great there is no doubt

    but ZendSkeletonApplication is not ! I think ZendSkeletonApplication should completely change. and another issue is performance. there is no good search result for zend framework performance ..

  22. 時計 メンズ ブランド ロレックス ターノグラフ http://www.nss5.com/

  23. Thank you for spreading this with us. You certainly know what it is you’re speakingg about.Saved! Take the time to check out my blog page I have invested a lot of time working on. A good idea would be to organize a backlink exchange agreement between the both of us.

    My page e Liquid Refills

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" color="" escaped="">