[PHP-WEBMASTER] [web-php] master: Sort builds in descending order in pre-release-builds

Author: Shivam Mathur (shivammathur)
Date: 2025-12-03T15:46:35+05:30

Commit: Sort builds in descending order in pre-release-builds · php/web-php@1cf5233 · GitHub
Raw diff: https://github.com/php/web-php/commit/1cf5233ef9d39d2da3d3def00fba720ed45992f2.diff

Sort builds in descending order in pre-release-builds

Changed paths:
  M pre-release-builds.php

Diff:

diff --git a/pre-release-builds.php b/pre-release-builds.php
index 59c68ee53e..83ccd72099 100644
--- a/pre-release-builds.php
+++ b/pre-release-builds.php
@@ -77,9 +77,15 @@

<h2 id="source">Source Builds</h2>
<?php if (!empty($QA_RELEASES['releases'])) : ?>
- <?php $plural = count($QA_RELEASES['releases']) > 1 ? 's' : ''; ?>
-
- <?php foreach ($QA_RELEASES['releases'] as $pversion => $info) : ?>
+ <?php
+ $sourceReleases = $QA_RELEASES['releases'];
+ uksort($sourceReleases, static function ($a, $b) {
+ return version_compare($b, $a);
+ });
+ $plural = count($sourceReleases) > 1 ? 's' : '';
+ ?>
+
+ <?php foreach ($sourceReleases as $pversion => $info) : ?>
   <h3 class="title">
     PHP <?php echo $info['version']; ?>
   </h3>
@@ -258,6 +264,11 @@
         'builds' => $builds,
       ];
     }
+ if (!empty($winQaReleases)) {
+ usort($winQaReleases, static function ($a, $b) {
+ return version_compare($b['version_label'], $a['version_label']);
+ });
+ }
   } else {
     $winQaMessage = 'Windows QA release index could not be parsed.';
   }