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.
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!