Latest in branch 5.0
5.0.11
Released 24 Jul 2020
(5 years ago)
SoftwareSymfony
Version5.0
Status
End of life
Supported
PHP versions
PHP ≥ 7.2.5
Initial release5.0.0
21 Nov 2019
(6 years ago)
Latest release5.0.11
24 Jul 2020
(5 years ago)
End of bug fixesJul 2020
(Ended 5 years, 10 months ago)
End of security fixesJul 2020
(Ended 5 years, 10 months ago)
Release noteshttps://github.com/symfony/symfony/releases/tag/v5.0.11
Source codehttps://github.com/symfony/symfony/tree/v5.0.11
Documentationhttps://symfony.com/doc/current/index.html
Downloadhttps://symfony.com/download
Symfony 5.0 ReleasesView full list

What Is New in Symfony 5.0

Symfony 5.0 is a cleanup release that removes deprecated features introduced in earlier 4.x versions. The core focus is on a leaner codebase and modern PHP practices, requiring PHP 7.2.5 or higher.

Category Key Changes
New Features New Uid component, new IsGranted attribute for security, @ParamConverter as PHP attribute.
Improvements Cleaner default directory structure, removal of src/ subnamespaces, updated recipes.
Deprecated Code Removal All code deprecated in Symfony 4.x is gone. This includes container parameters, bundle inheritance, legacy form features, and more.
Dependency Updates Twig 3, Doctrine Bundle 2, PHPUnit 8+ support, and updated many third-party package constraints.

What deprecated features were removed in Symfony 5?

All features marked as deprecated in Symfony 4.x versions have been completely removed. This is the main theme of the 5.0 release. In practice, this means your application will break if you haven't addressed these deprecation notices during your 4.x development cycle.

Key Removals Include:

  • Container Parameters: Global parameters like container.dumper.inline_class_loader and session.save_path are no longer defined by default.
  • Bundle Inheritance: The getParent() method in bundles is no longer supported.
  • Legacy Form Features: Support for the choice field's choices_as_values option and the format option in Date/Time types is removed.
  • FrameworkBundle Templating: The templating component integration is gone; use Twig instead.
  • Validator: The checkMX and checkHost options for the Email constraint are removed.

Are there any new components or features added?

Yes, Symfony 5.0 introduces a few targeted additions alongside the major cleanup. The most notable is the new Uid component, which provides utilities to generate and work with UUIDs and ULIDs.

For developers using annotations, there's a new @IsGranted attribute from SecurityBundle that simplifies access control in controllers. The @ParamConverter annotation from SensioFrameworkExtraBundle can now also be used as a native PHP 8 attribute.

The default project structure is also cleaner. For example, the generated src/Controller/ class no longer lives under a redundant App\ subnamespace, making it simply App\Controller.

What are the minimum PHP and third-party package requirements?

Symfony 5.0 requires PHP 7.2.5 or higher. This matters because it allows the framework to rely on modern PHP features without polyfills for older versions.

Third-party bundles and components have also bumped their minimum versions. Key updates include Twig 3, Doctrine Bundle 2, and PHPUnit 8. If you're upgrading, you need to check your composer.json for compatibility with these new constraints. The Flex recipes have been updated to reflect these changes.

How does the directory structure change in a new Symfony 5 project?

The new structure is flatter and removes some historical quirks. When you create a fresh Symfony 5.0 project, you'll notice the src/ directory no longer has the redundant App\ subdirectory structure inside it.

Previously, a controller lived in src/App/Controller/. Now, it's directly in src/Controller/. This change simplifies autoloading and aligns better with standard PHP practices. Existing projects aren't forced to change, but new ones will follow this pattern.

FAQ

Is Symfony 5.0 a major rewrite with breaking changes?
No, it's not a rewrite. It's a stabilization release that removes code previously marked as deprecated in the 4.x series. The core architecture remains the same, but you must fix deprecations before upgrading.

Can I upgrade directly from Symfony 3.4 or 4.0 to 5.0?
Directly, no. You must first upgrade to the latest Symfony 4.4 release and fix all deprecation notices. The 4.4 version is a Long-Term Support (LTS) release that includes all the deprecation warnings you need to address for a smooth jump to 5.0.

What happened to the templating component (PHP) in Symfony 5?
The integration of the templating component (for PHP templates) in FrameworkBundle has been removed. Symfony now uses Twig as its sole official templating engine. You can still use PHP templates if you manually configure the component, but it's no longer the default.

Are there any new security features in Symfony 5.0?
The main security addition is the @IsGranted attribute, provided by the SensioFrameworkExtraBundle. It offers a more concise way to secure controller actions compared to the traditional @Security annotation or in-code checks.

What is the Uid component used for?
The new Uid component generates and manipifies unique identifiers like UUIDs (versions 1, 3, 4, 6) and ULIDs. It's a lightweight, framework-agnostic utility that can be used independently in any PHP project for robust ID generation.

Releases In Branch 5.0

VersionRelease date
5.0.1124 Jul 2020
(5 years ago)
5.0.1012 Jun 2020
(5 years ago)
5.0.931 May 2020
(6 years ago)
5.0.828 Apr 2020
(6 years ago)
5.0.730 Mar 2020
(6 years ago)
5.0.627 Mar 2020
(6 years ago)
5.0.529 Feb 2020
(6 years ago)
5.0.431 Jan 2020
(6 years ago)
5.0.321 Jan 2020
(6 years ago)
5.0.219 Dec 2019
(6 years ago)
5.0.101 Dec 2019
(6 years ago)
5.0.021 Nov 2019
(6 years ago)
5.0.0-RC117 Nov 2019
(6 years ago)
5.0.0-BETA213 Nov 2019
(6 years ago)
5.0.0-BETA112 Nov 2019
(6 years ago)