How 7.4 and 8.1 differ

← How 7.4 and 8.1 differ

Ashterix

docs(articles): SEO titles, intros and a section preview image for From Magento to Symfony

en/articles/magento-to-symfony/practice/versions.md +6 −0

How 7.4 and 8.1 differ

Symfony 7.4 LTS and 8.x have the same features; they differ in deprecated code, support windows and the minimum PHP version. A short guide to what to pick for a new project and how to upgrade.

As of 2026-10-27, according to symfony.com/releases.

Symfony 7.4 and 8.0 were released at the same time in November 2025 with the same features. The only difference is deprecated code: 7.4 keeps all the compatibility layers of the 7.x branch, while 8.0 removed them. In other words, 8.0 is 7.4 without deprecations. 8.1 was released in May 2026 and added new features on top of 8.0. The backward compatibility promise applies, so moving from 8.0 to 8.1 requires no code changes.

Aspect 7.4 LTS 8.1
Release November 2025 May 2026
Release type LTS, the last minor version of the 7.x branch a regular minor release of the 8.x branch
Support bug fixes until November 2028, security until November 2029 until January 2027; then 8.2 (expected in November 2026), 8.3, 8.4 LTS (expected in November 2027)
PHP 8.2+ 8.4+
Deprecated code works, logs deprecations removed in 8.0
New features none until 8.4 LTS every six months in a new minor version
XML config for the container and routing works, but deprecated removed; YAML, PHP and attributes remain

What breaks when moving from 7.4 to 8.x

  • PHP 8.4. Without it, Composer won't install a single 8.x package.
  • Annotation namespaces. Symfony\Component\Routing\Annotation\Route no longer works, and routes using it simply disappear. You need Symfony\Component\Routing\Attribute\Route, and the same applies to other attributes.
  • Constraints with an options array. new Assert\Length(['max' => 800]) has to be rewritten with named arguments: new Assert\Length(max: 800).
  • XML config. Services and routes in XML have to be moved to YAML, PHP or attributes.
  • Dependencies. Every bundle in composer.json must allow Symfony 8. A package constrained to ^7.0 blocks the upgrade until its authors release a compatible version.

The most reliable way to find all of this in your code is to run the tests on 7.4 with deprecation output and fix every one. You fix a direct deprecation in your own code, an indirect one (from vendor/) by updating the package. Rector is handy for bulk replacements.

Symfony · the 7.4 → 8.x path

vendor/bin/phpunit --display-deprecations   # on 7.4: fix every deprecation
composer require "symfony/*:^8.1"           # or change the constraints in composer.json and run composer update "symfony/*"
bin/console cache:clear
vendor/bin/phpunit

What's new in 8.1

Area What appeared Why it's useful
Applications without HTTP a full DI container without HttpKernel workers and console processes without the HTTP layer
Console several commands in one class (method-based commands); argument resolvers that turn input into typed values and objects fewer wrapper classes for console entry points
Messenger batch fetching (--fetch-size), AMQP priorities, smarter retries, configurable reset (--no-reset accepts a number) cheaper workers on large queues
DependencyInjection lazy env loading for long-running workers, stacked decoration, decorates_tag, deeper integration with #[Target] decorators for a whole group of tagged services
Validator new constraints, Clock support, reentrant validators date validation via Clock is testable without real time
HttpClient persistent cURL, Guzzle handler, custom DNS, SSRF allow-list, mocking a specific client faster calls to neighbouring services, simpler integration tests
RateLimiter the #[RateLimit] attribute, calendar-based window mode rate limiting right on the controller, without a custom listener
HTTP controllers the #[Serialize] attribute for the response, extended #[Cache], files and variadics in payload mapping, request header mapping less code in API controllers
New components DeepCloner (deep cloning of object graphs), Tui (full-screen terminal interfaces) DeepCloner is for state snapshots in tests and caches
Profiler "Copy as cURL" for a request, a more accessible toolbar, smarter debug:* a request from the profiler is easy to reproduce in the terminal

What to choose

  • A new project: 8.x. Upgrade every six months: 8.1 → 8.2 → 8.3 → 8.4 LTS. Minor upgrades don't break code, and 8.1 is supported only until January 2027.
  • An application that won't be upgraded for years: 7.4 LTS: security fixes until November 2029, but no new features.
  • Moving from 7.4: first reach zero deprecations on 7.4, then go straight to the current 8.x, skipping 8.0: its support ended in July 2026.