From cb0cd727823cb5ba201fe6353aa7598960755297 Mon Sep 17 00:00:00 2001 From: Lu Fei <52o@qq52o.cn> Date: Mon, 23 Oct 2023 16:25:31 +0800 Subject: [PATCH] Fix env set list array error --- src/think/Env.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/think/Env.php b/src/think/Env.php index f1772ea528..20d91ee63d 100644 --- a/src/think/Env.php +++ b/src/think/Env.php @@ -115,7 +115,11 @@ public function set($env, $value = null): void foreach ($env as $key => $val) { if (is_array($val)) { foreach ($val as $k => $v) { - $this->data[$key . '_' . strtoupper($k)] = $v; + if (is_string($k)) { + $this->data[$key . '_' . strtoupper($k)] = $v; + } else { + $this->data[$key][$k] = $v; + } } } else { $this->data[$key] = $val;