From a74e4a12265140a4a00ee11d32c4c129c9cd0978 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 31 Mar 2026 15:03:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(php):=20=E8=A7=A3=E5=86=B3=E9=9D=9E?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=BC=95=E7=94=A8=E8=B5=8B=E5=80=BC=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加了对非变量引用赋值的错误检查 - 当无法为非变量赋值引用时抛出致命错误 - 移除了原来的abort调用改为适当的错误处理机制 --- src/Php/CompilerBase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 52c88080..90cd516b 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -3708,8 +3708,9 @@ class CompilerBase extends \PhpAot\Core\Translator return $left . ' = ' . $object . '.attrRef(' . $prop . ')'; } + } else { + $this->fatalError($expr, 'Cannot assign reference to non-variable'); } - abort($expr); } protected function parseMethodCall(Node\Expr\MethodCall $expr): string