apparently opcache_get_status() may return false?

This commit is contained in:
Dylan K. Taylor 2021-07-17 21:11:12 +01:00
parent 2588895ab0
commit bd5f379c4c
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -139,8 +139,8 @@ namespace pocketmine {
if(\Phar::running(true) === ""){
$logger->warning("Non-packaged installation detected. This will degrade autoloading speed and make startup times longer.");
}
if(function_exists('opcache_get_status')){
$jitEnabled = opcache_get_status(false)["jit"]["on"] ?? false;
if(function_exists('opcache_get_status') && ($opcacheStatus = opcache_get_status(false)) !== false){
$jitEnabled = $opcacheStatus["jit"]["on"] ?? false;
if($jitEnabled !== false){
$logger->warning(<<<'JIT_WARNING'