Skip to content

fix: lower the PHP floor back to 8.1 - #207

Open
e0ipso wants to merge 1 commit into
mainfrom
fix/php-floor
Open

fix: lower the PHP floor back to 8.1#207
e0ipso wants to merge 1 commit into
mainfrom
fix/php-floor

Conversation

@e0ipso

@e0ipso e0ipso commented Aug 19, 2026

Copy link
Copy Markdown
Member

4.0.0 raised php from >=8.1 to >=8.3. Nothing here needs it: the newest syntax in the library is readonly promoted properties (PHP 8.1), with no enums and no 8.2/8.3-only constructs.

Why it matters more than a version bump usually would

Composer resolves a too-high transitive PHP constraint by selecting an older version of whatever depends on the package, rather than reporting a platform problem. This floor therefore reaches consumers as a silent downgrade:

platform PHP what composer require drupal/media_mpx gives
8.1 mpx-php 3.1.4 — an older media_mpx release
8.2 mpx-php 3.1.4 — an older media_mpx release
8.3 mpx-php 4.2.0 — current

The symptom a user sees is "my dependency did not update", with no error message to search for. drupal/media_mpx supports drupal/core: ^10 || ^11, and Drupal 10's own floor is 8.1, so this cuts off a supported configuration.

Changes

  • php: >=8.1.
  • CI only ever ran PHP 8.3, which is how a floor nothing required went unnoticed. It now runs the floor too:
    • build_php81 — lowest PHP with --prefer-lowest, which resolves Symfony 6 (Symfony 7 needs PHP 8.2)
    • build_php82 — fills the gap to the existing 8.3 job
    • build_php83 — unchanged, keeps the coverage job

Verification

--prefer-lowest resolution at each PHP version via config.platform.php:

platform PHP doctrine/annotations symfony/serializer phpunit
8.1.0 1.12.0 6.0.0 9.6.33
8.2.0 1.12.0 6.0.0 9.6.33
8.3.31 1.12.0 6.0.0 9.6.33

Suite passes and php-cs-fixer reports no changes on 8.3, which is the only runtime I have locally — the new 8.1 and 8.2 jobs are what actually prove those.

Pairs with Lullabot/drupal-symfony-lock#9, which does the same thing there. Both are needed for a Drupal 10 site below PHP 8.3 to resolve the current media_mpx.

4.0.0 raised `php` from `>=8.1` to `>=8.3`. Nothing in the library needs it:
the newest syntax used is `readonly` promoted properties, which is PHP 8.1,
and there are no enums or 8.2/8.3-only constructs.

The floor has a cost that is easy to miss. Composer resolves a too-high
transitive PHP constraint by selecting an older version of whatever depends on
the package, rather than reporting a platform problem. So a Drupal 10 site on
PHP 8.1 or 8.2 asking for drupal/media_mpx quietly receives a 2023 release
with nothing explaining why -- the symptom is "my dependency did not update",
with no error to search for.

CI only ever ran PHP 8.3, which is how a floor nothing required went
unnoticed. It now runs the floor as well:

  * build_php81 -- lowest PHP with `--prefer-lowest`, which resolves Symfony 6
    since Symfony 7 requires PHP 8.2
  * build_php82 -- fills the gap to the existing 8.3 job
  * build_php83 -- unchanged, keeps coverage

Verified `--prefer-lowest` resolution at PHP 8.1, 8.2 and 8.3 via
config.platform.php: doctrine/annotations 1.12.0, symfony/serializer 6.0.0 and
PHPUnit 9.6.33 in every case. The suite passes and php-cs-fixer reports no
changes on 8.3; the new jobs are what will prove 8.1 and 8.2 at runtime.
@deviantintegral

Copy link
Copy Markdown
Member

@e0ipso Given that PHP 8.1 doesn't get security updates anymore, it seems like it would be reasonable to support 8.2 but not 8.1?

https://www.php.net/supported-versions.php

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.

2 participants