Skip to content

Commit

Permalink
[PHP 8.4] Change PHP_ZTS constant usage to ZEND_THREAD_SAFE
Browse files Browse the repository at this point in the history
In PHP 8.4, the type of `PHP_ZTS` 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_THREAD_SAFE`, which contains the same value but as a `bool` across all PHP versions.
  • Loading branch information
Ayesh committed Jan 9, 2024
1 parent 4db38ee commit ba85610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PocketMine.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function check_platform_dependencies(){
* @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)){
Expand Down

0 comments on commit ba85610

Please sign in to comment.