From 8d8cb358d5a6160b8f3a2e81af32b9bb903c7fb5 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 27 Jan 2026 19:46:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(php):=20=E6=B7=BB=E5=8A=A0=E5=AF=B9=20$$?= =?UTF-8?q?=20=E8=AF=AD=E6=B3=95=E7=9A=84=E6=A3=80=E6=B5=8B=E5=92=8C?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在变量表达式解析过程中添加对象类型检查 - 当遇到 $$ 语法时触发致命错误提示 - 阻止不支持的变量变量语法继续执行 - 提供明确的错误信息帮助开发者识别问题 --- src/Php/CompilerBase.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 97f4172f..241f22a8 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -405,6 +405,9 @@ class CompilerBase extends \PhpAot\Core\Translator $type = $expr->getType(); switch ($type) { case self::EXPR_VARIABLE: + if (is_object($expr->name) and $this->isVarExpr($expr->name)) { + $this->fatalError($expr, 'The `$$` syntax is not supported'); + } return $this->escapeVarName($expr->name); case 'Name': case 'VarLikeIdentifier':