Skip to content

Pin Symfony dependencies to ^7.4.0 to restore PHP 8.3 compatibility#59570

Closed
kuromadara wants to merge 1 commit intolaravel:13.xfrom
kuromadara:fix/symfony8-php83-compatibility
Closed

Pin Symfony dependencies to ^7.4.0 to restore PHP 8.3 compatibility#59570
kuromadara wants to merge 1 commit intolaravel:13.xfrom
kuromadara:fix/symfony8-php83-compatibility

Conversation

@kuromadara
Copy link
Copy Markdown

[13.x] Restoring PHP 8.3 Compatibility by Pinning Symfony ^7.4.0

Description

This PR addresses a dependency resolution issue in Laravel 13.x where transitive Symfony 8.0 components were forcing a PHP 8.4 requirement, despite Laravel 13 officially supporting PHP 8.3+.

By pinning the symfony/* dependencies to ^7.4.0 (and ^7.4.5 for symfony/process) across the framework and its sub-packages, we ensure that Composer resolves to Symfony 7.x on PHP 8.3 systems, fulfilling the framework's availability requirements.

Related Issue

Fixes #59564

Benefit to End Users

Ensures that developers on PHP 8.3 can smoothly install and use Laravel 13 without encountering "Requirement not satisfied (php: ^8.4)" errors caused by transitive dependency resolution.

Why it does not break any existing features

  • Symfony 7.4 is fully compatible with both Laravel 13 and PHP 8.3 through 8.5.
  • The framework's core functionality is unaffected by this dependency pin.
  • Verified that all 1,800+ core tests on the 13.x branch pass with the same results as the existing baseline.

Verification Conducted

  • PHP 8.3 Verification: Executed composer update on a PHP 8.3 environment; confirmed all Symfony components resolved correctly to v7.4.x.
  • PHP 8.5 Verification: Successfully bootstrapped a fresh Laravel application and verified fundamental routing and request handling.
  • Test Suites: Successfully ran the following core test suites:
    • tests/Console
    • tests/Http
    • tests/Routing
    • tests/Mail
    • tests/Session
    • tests/Filesystem
    • tests/Foundation

Note: This PR targets the 13.x branch to ensure the upcoming major version maintains its documented PHP 8.3 support.

@rodrigopedra
Copy link
Copy Markdown
Contributor

Composer will only pull Symfony 8 components on a system not running PHP 8.3.

If you develop a Laravel 13 app on a system with PHP 8.4 or 8.5 but need to support it running on an environment running PHP 8.3, you can add the following key to your project's composer.json config section:

{
    "config": {
        "platform": {
            "php": "8.3.30"
        }
    }
}

Pinning it to the lowest PHP version your project needs to support.

Composer will use this information when resolving dependencies and won't pull any incompatible dependency.

In other words, with this key added, Composer will keep pulling Symfony 7.4 components even if the development environment runs PHP 8.4 or 8.5.

@GrahamCampbell
Copy link
Copy Markdown
Collaborator

As @rodrigopedra says, this is not an issue, and the real problem is that you are specifically asking composer to install dependencies compatible with PHP 8.4, which is why they don't necessarily work on PHP 8.3. This has always been true, and if you install older versions of Laravel on a newer version of PHP, it also may not work properly on the oldest supported PHP version. You need to either run composer using the lowest version of PHP you want the dependencies to be compatible with, or ask its resolver to emulate the PHP version.

This PR should not be merged, and no action needs to be taken.

@laratables
Copy link
Copy Markdown

Laravel 12 uses symfony/console: ^7.2.0 and symfony/error-handler: ^7.2.0 GitHub — Symfony 7 only, no Symfony 8, so Laravel 12 on PHP 8.3 works perfectly fine with no issues.
Laravel 13 uses symfony/var-dumper: ^7.4.0 || ^8.0.0 GitHub across all Symfony components — this is the || ^8.0.0 that causes the problem on PHP 8.3 when Composer resolves to Symfony 8.

@laratables
Copy link
Copy Markdown

Composer will only pull Symfony 8 components on a system not running PHP 8.3.

If you develop a Laravel 13 app on a system with PHP 8.4 or 8.5 but need to support it running on an environment running PHP 8.3, you can add the following key to your project's composer.json config section:

{
    "config": {
        "platform": {
            "php": "8.3.30"
        }
    }
}

Pinning it to the lowest PHP version your project needs to support.

Composer will use this information when resolving dependencies and won't pull any incompatible dependency.

In other words, with this key added, Composer will keep pulling Symfony 7.4 components even if the development environment runs PHP 8.4 or 8.5.

That makes sense, thank you for your quick response :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Laravel 13.3+ requires PHP 8.4 due to Symfony 8 transitive dependency

6 participants