Skip to content

Raise the minimum PHP version to 8.1 and test every supported PHP branch in CI #595

Closed
6 of 6 issues completed

Description

@armanist

Summary

Raise the minimum supported PHP version from 8.0 to 8.1 and run CI on the PHP branches people actually use.

Why

PHP 8.0 no longer receives security fixes from the PHP project, and CI tests only 8.0, 8.1 and 8.2, so 8.3 is never exercised. 8.1 is a step up from 8.0 (enums, readonly properties, and the newer Symfony 6.4 line). PHP 8.1 is also end-of-life, so the minimum is expected to move again.

Proposed change

  • composer.json: "php": "^8.1".
  • Declare the return types PHP 8.1 expects on ResponseHeaders (offsetGet, current, key) and DatabaseHandler (gc). On PHP 8.1 and newer each raises a deprecation when the class loads, which Quantum's error handler turns into a fatal error. The tests missed it because phpunit.xml hides deprecations.
  • CI matrix: 8.1, 8.2 and 8.3 (8.0 is dropped). Newer branches can be added later.
  • DatabaseHandler::gc() returns the number of deleted sessions, as SessionHandlerInterface::gc() documents. It returned 0 after any successful delete.
  • PHPStan phpVersion and Rector's level set move to 8.1. Three Rector rules are skipped until Adopt the PHP 8.1 syntax Rector proposes and remove its skips #601: readonly properties and the two first-class callable rules, which would change 52 files and break four tests.
  • Changelog: a BREAKING entry for 3.1.0.

Sub-issues

The other things the update touches are tracked separately: moving the Symfony packages to 6.4 (#596), the OpenAPI templates and doctrine/annotations (#597), the Idiorm deprecation on PHP 8.1+ (#598) allowing psr/log 3 (#599), and adopting the PHP 8.1 syntax Rector proposes (#601).

Out of scope

  • Using 8.1 features in the code, such as turning AppType and LoggerType into enums.
  • A minimum of 8.2 or higher.

Breaking changes

  • PHP 8.0 can no longer install the framework. Applications on 8.0 stay on 3.0.x.

Follow-ups in other repos

  • quantum-php/project: composer.json, CI and requirements.
  • quantum-php/docs: the PHP requirement.

Acceptance criteria

  • composer test, composer cs:check, composer phpstan and composer rector:check pass on every PHP version in the matrix.

Notes

Relevant code:

  • composer.json, phpstan.neon.dist
  • src/HttpClient/ResponseHeaders.php, src/Session/Adapters/Database/DatabaseHandler.php
  • .github/workflows/

Activity

  1. added this to the 3.1.0 milestone on Oct 23, 2026
  2. self-assigned this
    on Oct 23, 2026
  3. added theissue type on Oct 23, 2026
  4. added a commit that references this issue on Oct 23, 2026
  5. added 5 commits that reference this issue on Oct 23, 2026
  6. added 2 commits that reference this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

breaking changeIntroduces or coordinates a breaking changetech debtTechnical debt reduction

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions