Author: Luffy (sy-records)
Committer: GitHub (web-flow)
Pusher: saundefined
Date: 2026-11-19T14:36:56+03:00

Commit: 
https://github.com/php/web-php/commit/c632c8554dd60ef899c96a7892c6862bca5c67a7
Raw diff: 
https://github.com/php/web-php/commit/c632c8554dd60ef899c96a7892c6862bca5c67a7.diff

Fix ensure default version is set when version is not recognized (#2085)

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


Diff:

diff --git a/public/downloads-get-instructions.php 
b/public/downloads-get-instructions.php
index f75e5a6da2..1fb0cbed71 100644
--- a/public/downloads-get-instructions.php
+++ b/public/downloads-get-instructions.php
@@ -2,6 +2,8 @@
 $file = 'unknown';
 $latestPhpVersion = '8.5';
 $versions ??= [];
+$multiversion = false;
+$source = false;
 
 if (!isset($options)) {
     $options = [
@@ -10,6 +12,10 @@
     ];
 }
 
+if (!array_key_exists($options['version'], $versions)) {
+  $options['version'] = 'default';
+}
+
 if ($options['os'] === 'windows') {
     if ($options['osvariant'] === 'windows-wsl-debian') {
         $options['os'] = 'linux';
@@ -26,18 +32,10 @@
     }
 }
 
-$multiversion = false;
-
 if (array_key_exists('multiversion', $options)) {
     $multiversion = $options['multiversion'] === 'Y';
 }
 
-if (!array_key_exists($options['version'], $versions)) {
-    $options['version'] = 'default';
-}
-
-$source = false;
-
 if (array_key_exists('source', $options)) {
     if ($options['source'] === 'Y') {
         $source = $options['source'] === 'Y';

Reply via email to