[PHP-WEBMASTER] [web-php] master: Fix regression: selected PHP version ignored on downloads page (#2083)

Author: Jordi Kroon (jordikroon)
Committer: GitHub (web-flow)
Pusher: TimWolla
Date: 2026-11-18T20:11:47+01:00

Commit: Fix regression: selected PHP version ignored on downloads page (#2083) · php/web-php@199cec4 · GitHub
Raw diff: https://github.com/php/web-php/commit/199cec4ccce64f891f1c3d86056a793050d332de.diff

Fix regression: selected PHP version ignored on downloads page (#2083)

Changed paths:
  M public/downloads-get-instructions.php

Diff:

diff --git a/public/downloads-get-instructions.php b/public/downloads-get-instructions.php
index 5e4fed31fc..f75e5a6da2 100644
--- a/public/downloads-get-instructions.php
+++ b/public/downloads-get-instructions.php
@@ -1,6 +1,7 @@
<?php
$file = 'unknown';
$latestPhpVersion = '8.5';
+$versions ??= [];

if (!isset($options)) {
     $options = [
@@ -31,7 +32,7 @@
     $multiversion = $options['multiversion'] === 'Y';
}

-if (!in_array($options['version'], $versions, true)) {
+if (!array_key_exists($options['version'], $versions)) {
     $options['version'] = 'default';
}