Symfony 6.1 will require PHP 8.1

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

                Sponsor the Symfony project.

https://symfony.com/blog/symfony-6-1-will-require-php-8-1?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

Vytvořeno 3y | 24. 2. 2022 16:20:22


Chcete-li přidat komentář, přihlaste se

Ostatní příspěvky v této skupině

New in Symfony 7.3: Assets Pre-Compression

Contributed by Kévin Dunglas in

23. 4. 2025 8:20:31 | Symfony
SymfonyOnline June 2025: Inside a Financial App Breach: Debugging a Million-Dollar Bug

SymfonyOnline June 2025 is almost here, starting in almost 2 months on:

June 10-11: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings. June 12-13: Online confe

22. 4. 2025 13:50:03 | Symfony
New in Symfony 7.3: Invokable Commands and Input Attributes

This is the first article in a series showcasing the most important new features introduced by Symfony 7.3, which will be released at the end of May 2025.

22. 4. 2025 9:10:36 | Symfony
A Week of Symfony #955 (April 14–20, 2025)

This week, the upcoming Symfony 7.3 version improved the AsAlias attribute by adding a new argument, introduced Clock support for UriSigner, and refined the return type of the ContainerInterface::get(

20. 4. 2025 8:30:06 | Symfony
SymfonyOnline June 2025: Rethinking File Handling in Symfony

SymfonyOnline June 2025 is almost here, starting in almost 2 months on:

June 10-11: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings. June 12-13: Online confe

16. 4. 2025 16:30:02 | Symfony
SymfonyLive Paris 2025: Recap and replay!

SymfonyLive Paris 2025 took place three weeks ago — a big thank you to everyone who joined us! The conference was held entirely in French, and now you can relive the best moments: replays, hig

15. 4. 2025 14:50:24 | Symfony
A Week of Symfony #954 (April 7–13, 2025)

This week, Symfony 7.3 entered its "feature freeze" period in preparation for its release at the end of May 2025. Development activity focused on refining and polishing its new features, including a n

13. 4. 2025 9:40:02 | Symfony