Symfony 8 is here
Engineered for productivity • Released in November 2025
- 2 years of development
- +615 diverse contributors
- +7,300 commits
- Requires PHP 8.4 or higher
Multi-Step Forms
Break complex Symfony forms into guided steps with per-step validation and conditional branching so users only see relevant fields. Based on the same form features and ideas you already know.
use Symfony\Component\Form\Flow\AbstractFlowType;
class UserSignUpType extends AbstractFlowType
{
public function buildFormFlow(FormFlowBuilderInterface $builder, array $options): void
{
$builder->addStep('personal', UserSignUpPersonalType::class);
$builder->addStep('professional', UserSignUpProfessionalType::class);
$builder->addStep('account', UserSignUpAccountType::class);
$builder->add('navigator', NavigatorFlowType::class);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => UserSignUp::class,
'step_property_path' => 'currentStep',
]);
}
}
New PHP Configuration
Symfony 8 drops XML and fluent PHP config in favor of PHP array shapes. A compact and expressive format with autocomplete and type validation. Not ready for it yet? You can use YAML too.
// config/packages/security.php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
return App::config([
'security' => [
// ...
'firewalls' => [
'main' => [
'pattern' => '^/*',
'lazy' => true,
'anonymous' => true,
],
],
'access_control' => [
['path' => '^/admin', 'roles' => 'ROLE_ADMIN'],
],
]
]);
Smaller
Symfony 8 source code removes all 7.4 deprecations, trimming 13,202 lines and keeping the codebase lean.
New Attributes
Configure services, check CSRF tokens, map request params and more with native PHP attributes.
More Constraints
Validate charsets, MAC addresses, ISO week numbers, word counts, YAML, slugs, Twig syntax, and video files with built-in constraints.
Invokable Commands and Input Attributes
Write commands as invokable classes. Skip the boilerplate class extending. Use PHP attributes for arguments, options, and interactive prompts. Less code, better autocomplete.
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Component\Console\Attribute\Ask;
use Symfony\Component\Console\Attribute\Option;
// ...
#[AsCommand(
name: 'app:create-user',
description: 'Adds new users to the system and optionally activates them'
)]
class CreateUserCommand
{
public function __invoke(
#[Argument(description: 'The user login or email address')] string $identifier,
#[Argument, Ask('Enter the full name')] string $name,
#[Option] bool $activate = false,
#[Option(suggestedValues: [self::class, 'getRoles'])] array $roles = ['ROLE_USER']
): int
{
// ...
}
}
Better exceptions
Terminal exceptions render as plain text with readable stack traces you can scan and copy without HTML noise.
Security Explained
Security voters can now explain their decisions. Debug authorization issues directly in the profiler or logs instead of guessing.
Compress Assets
Pre-compress assets with Zstandard, Brotli, or Gzip at build time and serve the smallest variant without runtime CPU cost.
Rock-solid stability
Symfony 8 is built on the latest Symfony Packages, the most popular set of PHP libraries. Battle tested in all popular PHP projects and with billions of downloads.
Smooth upgrade
Our Backward Compatibility Promise ensures that upgrading your applications to Symfony 8 will be a smooth experience. Learn more about how to upgrade to a major Symfony version.
Twig Extension Attributes
Define Twig functions and filters with attributes.
No base class extending.
Lazy-loaded by default for better performance.
use Twig\Attribute\AsTwigFilter;
class AppExtension
{
#[AsTwigFilter('product_number')]
public function formatProductNumber(string $number): string
{
// ...
}
}
New components
- TypeInfo: extracts PHP type information from properties/methods/functions.
- JsonPath: query and extract data from JSON using expressions.
- ObjectMapper: avoid repetitive mapping code between objects.
- JsonStreamer: a high-performance, low-memory JSON encoder/decoder.
Stateless CSRF
CSRF protection without sessions. Works with HTTP caching, perfect for stateless APIs and cached pages.
Better Routing
Define explicit mappings between route params and controller arguments for more precise conversion.
Single-File Apps
Build entire apps in a single file. Perfect for workers, CLI tools, microservices, and simple APIs. All the power, zero scaffolding.
Signed Messages
Add cryptographically secure signatures to Messenger payloads. Tamper-proof message queues out of the box.
New features
650+ new features shipped. Discover the main new features of Symfony 8.0.
Documentation
Read the Symfony 8.0 docs for details on new features and the main changes.
Upgrade
Read how to upgrade to a major Symfony version (e.g. from 7.x to 8.0)
Notes:
- Development and performance stats are calculated comparing Symfony 7.0 to Symfony 7.4.
- Highlighted features were introduced in different Symfony 7.x versions and show the differences between Symfony 7.0 and Symfony 8.0.
- Icons from the Tabler Project / MIT Licensed