From a68b0b1f930e04e82ed61c362166b64dc7c98660 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 4 Sep 2020 17:23:23 +0100 Subject: [PATCH] LightArray: make collectGarbage() more preload-friendly opcache preloading doesn't store non-class constants, but it does store class constants. Class constants that reference non-class constants are pre-resolved into values before storing in opcache SHM, so class constants are OK to use, but non-class constants will come back as undefined. --- src/world/format/LightArray.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/world/format/LightArray.php b/src/world/format/LightArray.php index cbe7cd25f..8752e8494 100644 --- a/src/world/format/LightArray.php +++ b/src/world/format/LightArray.php @@ -82,10 +82,10 @@ final class LightArray{ * reference to the const instead of duplicating the whole string. The string will only be duplicated when * modified, which is perfect for this purpose. */ - if($this->data === ZERO_NIBBLE_ARRAY){ - $this->data = ZERO_NIBBLE_ARRAY; - }elseif($this->data === FIFTEEN_NIBBLE_ARRAY){ - $this->data = FIFTEEN_NIBBLE_ARRAY; + if($this->data === self::ZERO){ + $this->data = self::ZERO; + }elseif($this->data === self::FIFTEEN){ + $this->data = self::FIFTEEN; } }