fix(php): 修复字符串数组访问语法错误

- 移除无效的 offsetSet 方法调用
- 解决字符串无法使用 [] 操作符的问题
pull/1/head
韩天峰 7 months ago
parent fe34c72c87
commit b39c2c4891
  1. 1
      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)) . ')';
}
}

Loading…
Cancel
Save