6.0.20

Latest release in branch 6.0
Released 3 years ago (February 01, 2023)

Software Symfony
Branch 6.0
Status
End of life
End of bug fixes January 2023
End of security fixes January 2023
First official release version 6.0.0
First official release date 4 years ago (November 29, 2021)
Supported
PHP versions
PHP ≥ 8.0.2
Release notes https://github.com/symfony/symfony/releases/tag/v6.0.20
Source code https://github.com/symfony/symfony/tree/v6.0.20
Documentation https://symfony.com/doc/current/index.html
Download https://symfony.com/download
Symfony 6.0 Releases View 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

Version Release date
6.0.20 3 years ago
(February 01, 2023)
6.0.19 3 years ago
(January 24, 2023)
6.0.18 3 years ago
(December 29, 2022)
6.0.17 3 years ago
(December 28, 2022)
6.0.16 3 years ago
(November 28, 2022)
6.0.15 3 years ago
(October 28, 2022)
6.0.14 3 years ago
(October 12, 2022)
6.0.13 3 years ago
(September 30, 2022)
6.0.12 3 years ago
(August 26, 2022)
6.0.11 3 years ago
(July 29, 2022)
6.0.10 3 years ago
(June 26, 2022)
6.0.9 3 years ago
(May 27, 2022)
6.0.8 3 years ago
(April 27, 2022)
6.0.7 4 years ago
(April 02, 2022)
6.0.6 4 years ago
(March 05, 2022)
6.0.5 4 years ago
(February 28, 2022)
6.0.4 4 years ago
(January 29, 2022)
6.0.3 4 years ago
(January 28, 2022)
6.0.2 4 years ago
(December 29, 2021)
6.0.1 4 years ago
(December 09, 2021)
6.0.0 4 years ago
(November 29, 2021)
6.0.0-RC1 4 years ago
(November 24, 2021)
6.0.0-BETA3 4 years ago
(November 18, 2021)
6.0.0-BETA2 4 years ago
(November 14, 2021)
6.0.0-BETA1 4 years ago
(November 05, 2021)