From db3bb55a2bf9daa658af6c119d2da9335d6a23bf Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Tue, 9 Jan 2024 12:28:20 +0000 Subject: [PATCH] Change `PHP_DEBUG` constant usage to `ZEND_DEBUG_BUILD` In PHP 8.4, the type of `PHP_DEBUG` changes from `int` to `bool`. See [PHP.Watch: PHP 8.4: `PHP_ZTS` and `PHP_DEBUG` constant value type changed from `int` to `bool`](https://php.watch/versions/8.4/PHP_ZTS-PHP_DEBUG-const-type-change). This changes the constants to `ZEND_DEBUG_BUILD`, which contains the same value but as a `bool` across all PHP versions. closes #6222 --- src/PocketMine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PocketMine.php b/src/PocketMine.php index 72d72506d..1209b28f0 100644 --- a/src/PocketMine.php +++ b/src/PocketMine.php @@ -166,7 +166,7 @@ namespace pocketmine { * @return void */ function emit_performance_warnings(\Logger $logger){ - if(PHP_DEBUG !== 0){ + if(ZEND_DEBUG_BUILD){ $logger->warning("This PHP binary was compiled in debug mode. This has a major impact on performance."); } if(extension_loaded("xdebug") && (!function_exists('xdebug_info') || count(xdebug_info('mode')) !== 0)){