Composer 2.4 and the platform-check you disabled in 2020

Composer generates a platform_check.php that aborts at autoload time when the running PHP does not satisfy the constraint, and plenty of projects switched it off during the 2.0 upgrade.

{
  "config": {
    "platform": { "php": "8.1.11" },
    "platform-check": false
  }
}

// with it off, a build machine on 8.1 and a runtime on
// 8.0 produces a fatal error somewhere in the middle of a
// request rather than at boot.

// "php-only" is the middle ground: check the version,
// skip the extension checks.

The check exists because the alternative failure is a call to a function that does not exist, at whatever point the request reaches it. Turning it back on requires the platform configuration to match the runtime, which is the work that was avoided in 2020 — and getting them to match is worth doing regardless, since a mismatch means the resolver is choosing packages for a PHP version you do not run.