From 07bf6e731df88b3795f77ca33b6a3496666f6458 Mon Sep 17 00:00:00 2001 From: Benjamin Roth Date: Tue, 19 Dec 2017 19:52:33 +0100 Subject: [PATCH] Handle PHP-bug with single char vars We encounter an issue with single-char PHP vars in production (running on amphp/aerys). We observe regularly, that single-char-vars become undefined. After PHP restart everything is ok again. The bug definitely exists in 7.1.9 + 7.1.11 Fixing that bug is hard, a workaround is simple and does not harm. Thanks! --- src/Adapter/Common/CacheItem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Adapter/Common/CacheItem.php b/src/Adapter/Common/CacheItem.php index 47c0081c..47e68c35 100644 --- a/src/Adapter/Common/CacheItem.php +++ b/src/Adapter/Common/CacheItem.php @@ -240,9 +240,9 @@ private function tag($tags) private function initialize() { if ($this->callable !== null) { - // $f will be $adapter->fetchObjectFromCache(); - $f = $this->callable; - $result = $f(); + // $func will be $adapter->fetchObjectFromCache(); + $func = $this->callable; + $result = $func(); $this->hasValue = $result[0]; $this->value = $result[1]; $this->prevTags = isset($result[2]) ? $result[2] : [];