From 278df1d5f1cb90dc6e7c1e6c05e5c6d6e7c0e85c Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Tue, 19 Nov 2024 11:32:23 +0700 Subject: [PATCH] [PHP 8.5] Use `PHP_BUILD_DATE` constant PHP 8.5 has a [new constant named `PHP_BUILD_DATE`](https://php.watch/versions/8.5/PHP_BUILD_DATE) that contains the same value as the `phpinfo` build date. We currently use "Build date" field parsed from `phpinfo` output, but on PHP 8.5, we can simply return the `PHP_BUILD_DATE` value. --- src/Debug/Utility/Php.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Debug/Utility/Php.php b/src/Debug/Utility/Php.php index b5655132..1811c638 100644 --- a/src/Debug/Utility/Php.php +++ b/src/Debug/Utility/Php.php @@ -36,6 +36,10 @@ class Php */ public function buildDate() { + if (\defined('PHP_BUILD_DATE')) { + return PHP_BUILD_DATE; + } + \ob_start(); \phpinfo(INFO_GENERAL); $phpInfo = \ob_get_clean();