From 296825b87ee412842b139125a5dccb9a04798cf9 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 22 Oct 2019 20:09:51 +0100 Subject: [PATCH] LightArray: collect garbage on unserialize serialize/unserialize don't preserve const refs, so this is necessary to reassign global refs post-unserialize --- src/world/format/LightArray.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/world/format/LightArray.php b/src/world/format/LightArray.php index 1b10eb489..cbe7cd25f 100644 --- a/src/world/format/LightArray.php +++ b/src/world/format/LightArray.php @@ -92,4 +92,9 @@ final class LightArray{ public function getData() : string{ return $this->data; } + + public function __wakeup(){ + //const refs aren't preserved when unserializing + $this->collectGarbage(); + } }