What you need to know about Symfony 5.2

· Jules Daunay · 2 minutes to read
slide_0

Symfony 5.2 was released in November 2020, and integrates many new helpful features into the framework. Here is our short overview of the best new functionalities to keep in mind.

Symfony 5.2 was released in November 2020, and integrates many new helpful features into the framework. Here is our short overview of the best new functionalities to keep in mind.

Shortly after its 15th anniversary, Symfony released its new version: Symfony 5.2.0. The Symfony Core Team and the whole Symfony community keep improving the framework according to the Symfony roadmap. This new minor version of Symfony includes many new helpful features.

As Nicolas Grekas explained in his interview about Symfony 5, a large number of new features appear with each major or minor evolution of the framework. Some minor releases can also introduce substantial new features.

The main new features in Symfony 5.2

Let’s explore the main features that have drawn our attention:

True colors in the console

The Symfony Console component provides a default style for your command output, but you can also apply custom styles and colors. Symfony 5.2 improves this feature because it supports 24-bit colors. In total, you now have at your disposal more than 16 million different colors to get all the colors of the rainbow within your console controls.

PHP 8 attributes

PHP 8 is a big change with new basic features like built-in attributes, also known as annotations. Symfony 5.2 includes support for PHP 8 attributes to define the required routes and dependencies. If you already use annotations, the transition will be seamless.

PHP enters a new golden age with the release of PHP 8, and Symfony is fully compatible. These attributes are just the beginning as new ones are planned soon to take full advantage of the new features of PHP 8.

Rate Limiter

A rate limiter controls how often an event (for example, an HTTP request or connection attempt) is allowed to happen. You can use rate limiting as a defensive measure to protect services from excessive usage. Symfony 5.2 introduces a new RateLimiter component so you can add those protections to your applications.

How SensioLabs developers contributed

We are proud to announce that a few developers from SensioLabs’ technical department participated in this new minor version of Symfony. Two key contributions came from SensioLabs developers: Simple DataCollectors and Session Profiling by Laurent Voullemier and Mathias Arlaud.

Simpler DataCollectors

The introduction of a new AbstractDataCollectors class simplifies the creation of custom data collectors in Symfony 5.2. From now on, the framework automatically saves this data collector and uses it from the next request. You don’t need to register services manually anymore.

Session Profiling

Session profiling is a great improvement in Symfony 5.2. Thanks to it, you can display all the information related to the current request session in the debug toolbar. Besides, the profiler now offers a new section called “Session” in the request/response panel. It also displays session metadata (for example, creation date, lifetime, etc.), session attribute names and values, and full details on how the session happened.

Congratulations to them for their contributions! Many developers from SensioLabs regularly contribute to Symfony: as the creator of Symfony, SensioLabs remains, of course, very close to the framework and encourages developer contributions from its team.

This might also interest you

The SensioLabs team celebrating the 20th anniversary of Symfony with balloons
Jules Daunay

The Story Continues: SensioLabs Celebrates Symfony's 20th Anniversary

Time flies, especially when you're busy shaping the future of development! The SensioLabs team has just reached a milestone with the anniversary of the Symfony framework. We marked the occasion at the office, but the party isn't over yet. The date is already set for an XXL celebration at SymfonyCon Amsterdam 2025, from November 27 to 28.

Read more
PHP 8.5 URI extension
Oskar Stark

PHP 8.5's New URI Extension: A Game-Changer for URL Parsing

PHP 8.5 introduces a powerful new URI extension that modernizes URL handling. With support for both RFC 3986 and WHATWG standards, the new Uri class provides immutable objects, fluent interfaces, and proper validation - addressing all the limitations of the legacy parse_url() function. This guide shows practical before/after examples and explains when to use each standard.

Read more
3 dog heads
Mathieu Santostefano

Bring Your Own HTTP client

Break free from rigid dependencies in your PHP SDKs. Learn how to use PSR-7, PSR-17, and PSR-18 standards along with php-http/discovery to allow users to bring their favorite HTTP client, whether it's Guzzle, Symfony HttpClient, or another. A must-read for PHP and Symfony developers.

Read more
Blue sign on a building with several Now What? letters
Thibaut Chieux

How To Prioritize Messages When Building Asynchronous Applications With Symfony Messenger

Asynchronous processing offers benefits like decoupled processes and faster response times, but managing message priorities can become a challenge. When dealing with tasks ranging from password resets to complex exports, ensuring timely delivery of critical messages is essential. This article explores common asynchronous processing issues and provides solutions using Symfony Messenger, allowing you to optimize your application without extensive refactoring.

Read more
SensioLabs University Courses announcing the new level 3 Master training course now available
Jules Daunay

Master Symfony: Unlock Expert Skills with Our Training

Take your Symfony proficiency from good to great with the new Level 3 training course at SensioLabs! Master complex topics, optimize performance, and become a Symfony expert.

Read more
Two images: on the left many cars stuck in a traffic jam with the sign "All directions" above, on the right a blue car moving forward alone on the highway with the sign "Service Subscriber" and a Symfony logo above
Steven Renaux

Symfony Lazy Services with Style: Boost DX using Service Subscribers

Boost your Symfony app's performance and developer experience! Learn how to use Service Subscribers and traits for lazy service loading to reduce eager instantiation, simplify dependencies, and create modular, maintainable code.

Read more
Poster of Guillaume Loulier presentation
Salsabile El-Khatouri

A Symfony Training at SensioLabs: Behind The Scenes

What does Symfony training at SensioLabs look like? Find out in this interview with Guillaume Loulier, a passionate developer and trainer, who tells us all about the official Symfony training courses.

Read more
Toy factory production line
Silas Joisten

Supercharging Symfony Testing with Zenstruck Foundry

Zenstruck Foundry has revolutionized the way we write tests in Symfony. In this post, you’ll learn how expressive factories, isolated test data, and a smoother developer experience helped us streamline our testing workflow and boost productivity.

Read more
Image