From b39c2c489120a9abe63310106bd67c4ae89068f8 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Wed, 4 Feb 2026 20:53:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(php):=20=E4=BF=AE=E5=A4=8D=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E6=95=B0=E7=BB=84=E8=AE=BF=E9=97=AE=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除无效的 offsetSet 方法调用 - 解决字符串无法使用 [] 操作符的问题 --- src/Php/CompilerBase.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 2e6949f7..aeb7c735 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -1086,7 +1086,6 @@ class CompilerBase extends \PhpAot\Core\Translator if ($left->dim === null) { $this->fatalError($left, 'Cannot use [] for strings'); } - return $tmp . '.offsetSet(' . $this->parseExpr($left->dim) . ', ' . $this->convertExprType($expr, $this->detectExprType($left), $this->detectExprType($right)) . ')'; } }