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
This commit is contained in:
Ayesh Karunaratne 2024-01-09 12:28:20 +00:00 committed by Dylan K. Taylor
parent 8372c9efc2
commit db3bb55a2b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -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)){