ADR-0042: The gate runs on PHP 8.4 and later, on Linux and macOS, and CI runs it on each
Status: Accepted Date: 2026-10-31 Amends: 0011: its supported PHP Amends: 0015: the lowest PHP its written CI sets up Amends: 0023: its warm worker's socket guard
Context
What holds the gate to PHP 8.5, read at source:
- The requirement.
composer.jsonrequiresphp: ^8.5, itsconfig.platform.phpis 8.5.12, and ADR-0011 supports 8.5 and later 8.x. The plugins require^8.5too. - PHP 8.4 is supported upstream. It has security support until 31 December 2028, and a project on it cannot install the gate.
- What of 8.5 the code uses.
- Clone-with,
clone($object, ['property' => $value]), in 247 places: it is how each immutable value returns a copy with a field changed. array_firstandarray_last, whichsymfony/polyfill-php85provides on 8.4.symfony/console8 andinfection/infectionalready require it.- Nothing else: PHPStan, set to PHP 8.4, reports clone-with alone.
- Clone-with,
- The lowest 8.4 the lock can name.
roave/security-advisoriesconflicts with PHP 8.4 below 8.4.28. - What checks the version. PHPStan and Rector's PHP sets read the
lowest PHP from
composer.json'srequire.php. - CI. Every job runs PHP 8.5 on Linux, and the
lowestjob runs the suite against the oldest release of every dependency. - Platforms. The README names no platform. A developer runs the gate
locally through
watch,pre-pushand the editor's commands, and the processes the gate starts and its forked workers are tested on Linux alone. - The warm worker's guard. Before its first fork, a warm worker refuses to fork while it holds any socket beyond its standard streams (ADR-0023). A process a macOS CI runner starts holds a socket of the runner's before the gate starts, so every worker there refuses and each mutant runs fresh.
Decision
This amends ADR-0011's items 3 and 10, ADR-0015's item 16 and ADR-0023's item 13.
The gate runs on PHP 8.4 and later 8.x.
composer.jsonand each plugin's requirephp: ^8.4, andconfig.platform.phpis 8.4.28, the lowest 8.4 the lock can name.composer.jsonrequiressymfony/polyfill-php85forarray_firstandarray_last.
An immutable value returns a copy through its constructor. A method that changes a field returns
new self(...)with every field, the changed one in its place. A class whose constructor took less than every field takes every field in a private constructor, and a staticoftakes what the public constructor took.Extensionsis built byExtensions::of(Origin), and an emptyEntriesbyEntries::none(ExtensionPoint).
Syntax PHP 8.4 lacks is refused before a run. PHPStan reads PHP 8.4 from
require.phpand fails on clone-with, and Rector's PHP sets offer no rule past 8.4.CI runs the suite on PHP 8.4 and 8.5. The
lowestjob runs PHP 8.4, the lowestrequire.phpadmits, against the oldest release of every dependency. Every other job runs PHP 8.5 against the lock.A CI definition the gate writes sets up PHP 8.4 at least, where the project asks for nothing higher (ADR-0015).
Linux and macOS are supported, and Windows is not. The
macosjob runs the suite on macOS against the lock. The README says so beside the PHP version.The warm worker's guard counts the sockets its boot opened. The worker counts the sockets it holds before it boots, and refuses to fork only where the boot left more open. A socket held before the boot was inherited from the process that started the worker, and every process the gate starts, warm or fresh, holds it alike.
Alternatives considered
| Option | Why it lost |
|---|---|
| PHP 8.5 alone, as ADR-0011 has it | Every project on 8.4, which upstream supports for two more years, cannot install the gate. |
| A helper that copies an object by reflection, with an array of changes | PHPStan cannot check the changed fields' types, which it checks on new self(...). |
Properties left writable inside the class, private(set), and changed on a clone | Each value would lose readonly, which holds that nothing changes it once built. |
| The whole CI on both versions | Twice the jobs for what the lowest job already runs on 8.4. |
A tests job matrix on 8.4 and 8.5 | Coverage is measured once, and the lowest job already runs the suite on 8.4. |
| The guard left as it is, and macOS runners running each mutant fresh | Warm workers would never run on a macOS runner, for a socket no boot opened and no child uses. |
| Windows supported | Nothing tests it, and a CI leg on Windows is a third platform to keep green for local use alone. |
Consequences
A project on PHP 8.4 installs the gate, and a developer on macOS runs it on a tested platform.
A copy names every field, so a value with many fields has long methods that change one. PHPStan checks each field's type.
A change that uses syntax PHP 8.4 lacks fails PHPStan, and one that
breaks on 8.4 at run time fails the lowest job.