From 5b1c771a2d4939b3ce3dc321252ea4eb30242ce8 Mon Sep 17 00:00:00 2001 From: Wang <69124377+YiwanGi@users.noreply.github.com> Date: Mon, 13 Feb 2023 13:47:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E9=94=AE=E5=90=8D=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用数字作为键名时set()成功保存 但是停止框架后再启动框架数据落地恢复时报错类型不符合 Fatal error: Uncaught TypeError: Swoole\Table::set(): Argument #1 ($key) must be of type string, int given in zhamao/vendor/zhamao/framework/src/ZM/Store/LightCache.php:81 --- src/ZM/Store/LightCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ZM/Store/LightCache.php b/src/ZM/Store/LightCache.php index 7868845c..d5d56a7d 100644 --- a/src/ZM/Store/LightCache.php +++ b/src/ZM/Store/LightCache.php @@ -75,7 +75,7 @@ class LightCache } else { return false; } - $result = self::$kv_table->set($k, [ + $result = self::$kv_table->set((string)$k, [ 'value' => $value, 'expire' => $v['expire'], 'data_type' => $data_type,