Stable Release in branch 6.0
6.0.20
Released 01 Feb 2023
(3 years ago)
SoftwareSymfony
Version6.0
Status
End of life
Supported
PHP versions
PHP ≥ 8.0.2
Initial release6.0.0
29 Nov 2021
(4 years ago)
Latest release6.0.20
01 Feb 2023
(3 years ago)
End of bug fixesJan 2023
(Ended 3 years ago)
End of security fixesJan 2023
(Ended 3 years ago)
Release noteshttps://github.com/symfony/symfony/releases/tag/v6.0.20
Source codehttps://github.com/symfony/symfony/tree/v6.0.20
Documentationhttps://symfony.com/doc/current/index.html
Downloadhttps://symfony.com/download
Symfony 6.0 ReleasesView full list

What Is New in Symfony 6.0

Symfony 6.0 is a major release that modernizes the framework by requiring PHP 8.1 and removing a significant amount of legacy code. This streamlines the codebase and unlocks new language features for developers. The focus is on cleaner, more type-safe applications.

Category Key Changes
New Features Stronger type system with PHP 8.1, PSR-7/17 support in HttpClient, new Uid component.
Improvements Faster, more reliable ux.symfony.com integration, enhanced Cache and Lock components.
Deprecations Removed All code deprecated before Symfony 5.4 has been dropped, including legacy container configuration and old session handling.
Requirements PHP 8.1 or higher is now mandatory.

Why is PHP 8.1 now a hard requirement?

Symfony 6.0 mandates PHP 8.1 to fully utilize its modern features like enums, readonly properties, and first-class callable syntax. This allows the framework to drop compatibility layers and legacy code, resulting in a leaner and more performant core. For developers, it means writing more expressive and robust code from the start.

What legacy code was cleaned up in this release?

The release removes all features that were deprecated before Symfony 5.4. Major cleanups include the old session service and SessionInterface, the legacy PhpFilesCache adapter, and support for Doctrine annotations. The container configuration no longer accepts the old service and prototype XML namespace.

In practice, this forces applications to use the modern, injected RequestStack for session access and the newer, more efficient caching adapters. It's a significant step towards a simpler framework architecture.

How does the type system get stronger?

Symfony 6.0 embraces PHP 8's type system by adding return type declarations to almost all methods across the framework's codebase. This includes methods in the KernelInterface, Command class, and various event listeners.

This matters because it catches type-related bugs earlier and improves IDE support. If you've been extending Symfony classes, you'll need to update your child methods to match these new signatures.

What are the notable component additions?

HttpClient gains PSR-18 compatibility

The HttpClient component now implements PSR-18 (Psr\Http\Client\ClientInterface), allowing it to be used as a standard HTTP client in any PSR-18 compatible library. It also provides PSR-17 factories for creating requests and streams.

New Uid component for identifier generation

The new Symfony\Component\Uid component provides tools to generate and work with unique identifiers like ULIDs and UUIDs. It's fast, lightweight, and offers utilities for ramsey/uuid interoperability.

FAQ

Is upgrading to Symfony 6.0 difficult?
The main effort involves updating your PHP version to 8.1+ and addressing any use of code that was deprecated before Symfony 5.4. The Symfony upgrade tool and the deprecation detector can automate much of this process.

Can I still use annotations for routing and configuration?
Yes, but you must migrate from Doctrine Annotations to the native PHP attributes. Symfony 6.0 removes support for the legacy annotation format, but the switch to attributes is straightforward and offers better performance.

What happened to the old session service?
The session service and SessionInterface alias were removed. You must now inject the RequestStack service and call getSession() on the current request to access the session.

Does the Cache component still work the same way?
Mostly, but the PhpFilesCache adapter was removed in favor of PhpMarshallerCache. You should update your cache configuration to use the newer adapter, which is more reliable.

Are there any changes to how forms are handled?
The core form functionality remains stable. However, underlying type changes in extended classes (like added return types) may require you to update your custom form types if you override certain methods.

Releases In Branch 6.0

VersionRelease date
6.0.2001 Feb 2023
(3 years ago)
6.0.1924 Jan 2023
(3 years ago)
6.0.1829 Dec 2022
(3 years ago)
6.0.1728 Dec 2022
(3 years ago)
6.0.1628 Nov 2022
(3 years ago)
6.0.1528 Oct 2022
(3 years ago)
6.0.1412 Oct 2022
(3 years ago)
6.0.1330 Sep 2022
(3 years ago)
6.0.1226 Aug 2022
(3 years ago)
6.0.1129 Jul 2022
(4 years ago)
6.0.1026 Jun 2022
(4 years ago)
6.0.927 May 2022
(4 years ago)
6.0.827 Apr 2022
(4 years ago)
6.0.702 Apr 2022
(4 years ago)
6.0.605 Mar 2022
(4 years ago)
6.0.528 Feb 2022
(4 years ago)
6.0.429 Jan 2022
(4 years ago)
6.0.328 Jan 2022
(4 years ago)
6.0.229 Dec 2021
(4 years ago)
6.0.109 Dec 2021
(4 years ago)
6.0.029 Nov 2021
(4 years ago)
6.0.0-RC124 Nov 2021
(4 years ago)
6.0.0-BETA318 Nov 2021
(4 years ago)
6.0.0-BETA214 Nov 2021
(4 years ago)
6.0.0-BETA105 Nov 2021
(4 years ago)