About Symfony 3.0

Original author: Fabien Potencier
  • Transfer
Over the past year, I talked a lot about Symfony 3.0 at various conferences. I have been thinking about the best strategy for this version for a long time, and now it's time to share my thoughts with everyone.

Major version


Some developers and most project managers are afraid of updating major versions of their open source projects. This is probably due to the fact that major versions are associated with a loss of backward compatibility. Many questions arise: will the changes benefit my project? Are the developers' plans clear enough to make sense to be updated? Will updating be easy? What if I cannot or do not want to update? Etc.

The fear of major versions is rooted in our past: remember Perl 6 or PHP 6. In the world of Symfony, the second version was also revolutionary compared to symfony 1. I understand why people get nervous when they hear about the third version, and in this post I will tell you why you do not need to panic.

First of all, everyone knows that updates of both major and minor versions should occur regularly. We must be able to break backward compatibility in order to remove non-core functionality, correct architecture errors, and take into account changes in the ecosystem, such as new PHP features, new development methodologies, new web paradigms. The Internet environment is evolving very quickly, and if we do not adapt Symfony to it, it will become irrelevant much faster than you think.

As a Symfony project manager, I am responsible for keeping the code as stable as possible for as long as possible. But stability is not the status quo: we add features and correct architectural flaws in minor releases, as you can see in the versions 2.4 , 2.5 and2.6 . All these versions added functionality to the framework, and each of them was a noticeable step forward for the framework itself. But updating was just because backward compatibility was maintained . The problem is maintaining backward compatibility for outdated or irrelevant features (and I'm not even talking about performance!). For Symfony 2, it was quite simple, because it was built on a solid base of independent components. By definition of semantic versioning , the new major version is just the next step where we can clean up the code and get rid of the trash.
What is symfony 3.0?
Since new features are constantly added in minor versions, and obsolete ones are marked as such, you can start improving the compatibility of your code with Symfony 3.0 today. Read the upgrade guide and follow the suggested changes to help you prepare for migration in advance.

As you probably already guessed, the low-level architecture will not change dramatically in Symfony 3.0 , and the release will not be revolutionary. Here are examples of some of the changes in Symfony 2.x that will make 3.0 even better:

  • Compatibility with standards has been improved (we use a logger from PSR-3 and removed the interface Symfony \ Component \ HttpKernel \ Log \ LoggerInterface)
  • Symfony 3.0 fixed some architectural bugs (state-based console helpers are replaced with better alternatives, e.g. ProgressBar / ProgressHelper or Table / TableHelper; Yaml :: parse () no longer accepts file names)
  • Symfony 3.0 is even more distributed and reusable. HttpKernel will be divided into several smaller modules, for example, the profiler will be separated, classes will be moved from bundles to components, components will be separated from existing ones ...)

Symfony 3.0 release chart


You can avoid panic over new major versions if you communicate your intentions as early as possible. That is why the Symfony community has so carefully documented our strategy, from promises of backward compatibility to roadmap and releases with enhanced support.

One way to minimize fear of new versions is to make them predictable. According to our release schedule, Symfony 2.7, due out in May 2015, will be the next release with long-term support, which runs through May 2018 for bug fixes and until May 2019 for security updates. Instead of planning after 2.8, I suggest jumping straight to 3.0. So 3.0 will be released in November 2015, and the first release with extended support in the 3.x branch will be 3.3, which will be released in May 2017.

The interactive release schedule has also been updated with the 3.0 branch.

What do you do? According to the release process documentation chapter , there are two upgrade strategies:

Dual support mode was invented to make every Symfony user happy. For those who want to work with the freshest and coolest, there is a standard version that comes out every six months, and two months are allocated for the update. For those who need stability, there is a version with extended support: a new version is released every two years, and a year is given for updating.


Where to get Symfony 3.0?


To make it easier for everyone to help develop Symfony 3.0 now, the master branch of the main repository is now assigned to 3.0, and for 2.6 and 2.7 we created separate branches.

If your project uses the Symfony master branch to follow 2.x development, switch to 2.7 today.

The strategy for merging changes will be almost the same as now, with the exception of some changes:

  • New functionality will be added in 2.7 if it does not lead to a loss of compatibility, or if the changes do not affect the existing code
  • New features will be added in 3.0 if there is no way to get them to work in 2.7
  • Bug fixes will still be added to the oldest supported branch and to new branches (and 3.0 too) regularly

Minimum PHP Version for Symfony 3.0



Finally, what about the minimal version of PHP? A few days ago I conducted a survey on this topic, and the results are as follows:



Based on these results, I propose to make PHP 5.5 the minimum supported version for Symfony 3.0. I want to keep the ability to raise this requirement to PHP 5.6 sometime next year, but the exact date will depend on our needs and support for the new version by the hosters and OS distributions.

How to help?


There are many simple changes you can implement in Symfony 3.0 today. First of all, in branch 2.7, all obsolete features should report themselves to the log. In the master branch, these features should be removed. Finally, the upgrade guide should be tested and refined so that updating is easy and straightforward. You can also look at tickets that were tested as 3.0 on Github .

Have a nice code!

Also popular now: