Skip to content

ci(MSP-5160): add PHP 8.6 to the CI matrix - #703

Open
Maks Rafalko (maks-rafalko) wants to merge 3 commits into
masterfrom
ticket/MSP-5160-php-86
Open

ci(MSP-5160): add PHP 8.6 to the CI matrix#703
Maks Rafalko (maks-rafalko) wants to merge 3 commits into
masterfrom
ticket/MSP-5160-php-86

Conversation

@maks-rafalko

@maks-rafalko Maks Rafalko (maks-rafalko) commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Why

Adds PHP 8.6 to the CI matrix. PHP 8.6 is still a nightly/pre-release build ahead of GA (shivammathur/setup-php installs it as a nightly build of 8.6.0-dev), so the 8.6 legs are marked continue-on-error and fail-fast is disabled so a flaky pre-release build doesn't block merges or cancel the other legs.

Unlike that repo (which pins a container image tag), this repo uses shivammathur/setup-php, which supports installing PHP 8.6 directly via its nightly-build support - no image/tag pinning needed.

PHP 8.6 is still a nightly/pre-release build ahead of GA, so its
matrix legs are marked continue-on-error (with fail-fast disabled)
to avoid blocking merges while tracking the moving pre-release,
following the pattern from Lendable/doctrine-migrations-extensions#177.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@maks-rafalko Maks Rafalko (maks-rafalko) added the ai-implemented PR authored by an AI agent label Aug 13, 2026
PHP 8.6 appends "near location X:Y" to json_decode()'s underlying
error messages (e.g. "Syntax error" -> "Syntax error near location
1:34"), which DeserializationFailed passes through verbatim. Match
the message with a regex that accepts the optional suffix so the
same assertion holds across PHP 8.4/8.5 and the 8.6 nightly build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…PHP 8.6

infection/infection's own constraint on thecodingmachine/safe (^v3.0)
lets `--prefer-lowest` resolve v3.0.0, whose generated function-wrapper
dispatcher has no PHP 8.6 branch, so none of the Safe\* functions get
defined and infection crashes with "Call to undefined function
Safe\getcwd()". PHP 8.6 support landed in safe v3.4.0, so pin our own
require-dev floor there to force that version under lowest deps too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread composer.json
"phpunit/phpunit": "^13.2.6",
"rector/rector": "^2.5.7"
"rector/rector": "^2.5.7",
"thecodingmachine/safe": "^3.4.0"

@maks-rafalko Maks Rafalko (maks-rafalko) Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

without this, the build for PHP 8.6 lowest deps fails.

This is because infection/infection depends on thecodingmachine/safe:^3.0.0, but 3.0.0 (lowest) version doesn't have functions exported to 8.6 folder, while 3.4.0 (highest) does have it.

See https://github.com/thecodingmachine/safe/tree/v3.4.0/generated

The way how it works:

if (str_starts_with(PHP_VERSION, "8.5.")) {
    require_once __DIR__ . '/8.5/filesystem.php';
}

but there is not folder for 8.6.

The fix is to require dev(!) package here so we lock the minimum to 3.4.0. This will not impact consumers of this library as the dev package is ignored during resolving of the packages.

@maks-rafalko
Maks Rafalko (maks-rafalko) marked this pull request as ready for review August 13, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-implemented PR authored by an AI agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant