Historically, we've always tried to keep the minimum PHP version for a new major Symfony version (X.0
) for all its minor versions (X.Y
).
But recently, we've faced a challenge with PHP preloading (issue, tentative fix).
To make a long story short, prior to PHP 8.1 property types must be available when preloading a class. That's an issue for Symfony when a property references the type of an optional dependency.
We have considered several options to fix it: preventing non-autoloadable classes from being preloaded (but the more typed properties Symfony uses, the less classes would be preloaded), removing property types (that doesn't work for non-Symfony classes that can still use property types). But then, preloading itself is going to be almost useless as of PHP 8.1. So, why would we want to bother maintaining some complex logic to workaround this issue in PHP and limit ourselves in adopting property types just to support PHP 8.0 for the next 4 years (Symfony 6.0 supports PHP 8.0+)?
Now that you better understand the context, we considered one last option: bumping the minimum PHP requirement to PHP 8.1 in Symfony 6.1. According to Packagist, more than 70% of framework bundle installations are using PHP 8.1, and it grows fast. So, we are confident that the vast majority of our users will be using PHP 8.1 when 6.1 will be released at the end of May 2022. And the new Ubuntu LTS will support PHP 8.1 as well.
Even if community support is massive, we understand that they are special situations which will forbid some projects to be upgraded in a timely manner. So, to mitigate the minimum PHP version bump, we are extending Symfony 6.0 maintenance by an additional 6 months. So, end of life for both Symfony 6.0 and 6.1 will happen at the same time.
We have been thinking about this decision a lot during the last few weeks, and it seems like this is the only viable option that is sustainable for the project. We are aware that this might be inconvenient for some and we want to reassure you that bumping the minimum PHP version for a minor Symfony version will be considered only as a last resort option in the future. We have documented this change to make the process clear and transparent. You can think of this exception as being the equivalent of breaking backward compatiblity to be able to fix a security issue.
This is pretty clear. I was not aware of the problem, thank you for pointing out the problem and being transparent about it. (as always)
Thanks for your explanation. I am approve your decision 👌😉
Smart move for extending Symfony 6.0 support to 6 extra months!
"more than 70% of framework bundle installations are using PHP 8.1". Sorry, but this is wrong!
The link you posted is about how many Symfony 6.0 installations are already use PHP 8. If you have a look at overall framework bundle installations, it's about 25%. -> https://packagist.org/packages/symfony/framework-bundle/php-stats
@Andy Eberle-Bannert
The issue is affecting v6.0. Please take a look at https://github.com/symfony/symfony/issues/44364 So the "more than 70% of framework bundle installations are using PHP 8.1" context is about Symfony 6.0
I think this is a great decision. It would also enable symfony to already start using enums in symfony 6.1 already. At least for new stuff.
Good decision! For the people that depend on PHP versions shipped with a certain distribution, the 6.4 LTS version is the most important and I think it's a good signal to raise the minimum PHP version for that.
I like this. Nice!