Skip to content

THRIFT-5956: Bump minimum PHP version to 8.1#3435

Merged
sveneld merged 1 commit into
apache:masterfrom
sveneld:THRIFT-5956
May 3, 2026
Merged

THRIFT-5956: Bump minimum PHP version to 8.1#3435
sveneld merged 1 commit into
apache:masterfrom
sveneld:THRIFT-5956

Conversation

@sveneld
Copy link
Copy Markdown
Contributor

@sveneld sveneld commented May 2, 2026

Drop PHP 7.x and 8.0 from the supported floor for the PHP library and bump
the minimum to PHP 8.1. PHP 7.x is fully EOL upstream (7.0 since 2019,
7.4 since 2022) and 8.0 since 2023; the test suite has matured enough to
make this maintenance simplification safe.

Changes:

  • composer.json: require PHP ^8.1; collapse PHPUnit constraint to ^9.5
    (the only PHPUnit line that runs on PHP 8.1 without dropping the
    annotation-style tests we still use); bump phpcs to ^3.10.
  • lib/php/phpunit.xml: bump schema URL to 9.5.
  • .github/workflows/build.yml: drop the 7.1 / 7.2 / 7.3 / 7.4 /
    8.0 rows of the lib-php matrix.
  • build/docker/ubuntu-focal/Dockerfile: install PHP 8.1 from
    ppa:ondrej/php (focal default is 7.4, below the new floor).
  • build/docker/README.md: refresh the version table.
  • CHANGES.md: announce the breaking change under 0.24.0.

Migrating to PHPUnit 10/11 and modernizing the C++ → PHP generator output
(typed properties, native enums, declare(strict_types=1)) are intentionally
left to follow-up tickets.

Users still on PHP 7.x or 8.0 can remain on the 0.23.x release series.

  • Did you create an Apache Jira ticket? THRIFT-5956
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"? (Intentional breaking change — JIRA THRIFT-5956 is labelled Breaking-Change.)
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

Generated-by: Claude Opus 4.7 (1M context)

@sveneld sveneld requested review from Jens-G, fishy and jimexist as code owners May 2, 2026 08:24
@mergeable mergeable Bot added php build and general CI cmake, automake and build system changes github_actions Pull requests that update GitHub Actions code labels May 2, 2026
@sveneld
Copy link
Copy Markdown
Contributor Author

sveneld commented May 2, 2026

@pkvach FYI

Client: php

Drop PHP 7.x and 8.0 from the supported floor. PHP 7.x is fully EOL
upstream (oldest line 7.0 since 2019, latest 7.4 since 2022) and 8.0
since 2023.

  * composer.json: require PHP ^8.1; collapse PHPUnit constraint to
    ^9.5 (only PHPUnit version that runs on PHP 8.1 without dropping
    the legacy annotation-style tests we still use); bump phpcs to
    ^3.10.
  * lib/php/phpunit.xml: bump schema URL to 9.5.
  * .github/workflows/build.yml: drop the 7.1/7.2/7.3/7.4/8.0 rows of
    the lib-php matrix.
  * build/docker/ubuntu-focal/Dockerfile: install PHP 8.1 from
    ppa:ondrej/php (focal default is 7.4, below the new floor).
  * build/docker/README.md: refresh the version table.
  * CHANGES.md: announce the breaking change under 0.24.0.

Migrating to PHPUnit 10/11 and modernizing the C++ -> PHP generator
output (typed properties, native enums, declare(strict_types=1)) are
left to follow-up tickets.

Generated-by: Claude Opus 4.7 (1M context)
libtest-exception-perl

# PHP via Ondřej Surý PPA (focal default is 7.4 which is below our 8.1 floor)
RUN add-apt-repository -y ppa:ondrej/php && \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: Ondřej Surý is the maintainer of the PHP packages for Debian and Ubuntu (both the official ones and the ones you are using via the PPA).

@sveneld sveneld merged commit f9cd633 into apache:master May 3, 2026
84 checks passed
@kpumuk
Copy link
Copy Markdown
Member

kpumuk commented May 3, 2026

@sveneld I think it would be a good idea to update README.md in lib/php, which is rendered on the website: https://thrift.apache.org/lib/php.html

Specifically, minimum version, maybe mention we raised the minimum version in the breaking changes section.

@sveneld
Copy link
Copy Markdown
Contributor Author

sveneld commented May 3, 2026

I will update README.md after all planned changes will be completed.

Planned changes:

  • Update the PHPUnit version
  • Fix issues reported by PHPStan
  • Add type hinting
  • Update the PSR coding style

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

Labels

build and general CI cmake, automake and build system changes github_actions Pull requests that update GitHub Actions code php

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants