From 428b979e6bae4306de1338e74813223462d1c018 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 31 May 2026 11:03:42 -0400 Subject: [PATCH] chore(build-index.php): update for PHP >=8.5 Use http_get_last_response_headers() (available in PHP >=8.4.0) instead of DEPRECATED (in PHP >= 8.5.0) $http_response_header. Signed-off-by: Josh --- build/build-index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/build-index.php b/build/build-index.php index b19d56c2422..3fddb7d5afe 100644 --- a/build/build-index.php +++ b/build/build-index.php @@ -36,6 +36,12 @@ function is_version_released(int $version): bool { ]); $response = @file_get_contents($url, false, $context); + + // FIXME: function_exists conditional can be dropped once we don't need to support <8.4.0 + if (function_exists('http_get_last_response_headers')) { + /** @var array|null */ + $http_response_header = \http_get_last_response_headers(); + } if (isset($http_response_header) && is_array($http_response_header)) { return strpos($http_response_header[0] ?? '', '200') !== false;