From 7f260f3d526976c00231d2dc7fa293e10c2d859e Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 28 Apr 2026 19:22:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(php):=20=E4=BF=AE=E5=A4=8D=E6=95=B4?= =?UTF-8?q?=E6=95=B0=E7=B1=BB=E5=9E=8B=E5=9C=A8macOS=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E5=90=8E=E7=BC=80=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 根据平台类型动态选择整数后缀,macOS使用LL,其他平台使用L - 解决了跨平台编译时整数类型不一致的问题 --- src/Php/CompilerBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index d92d0678..5e2d7a06 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -963,7 +963,7 @@ class CompilerBase extends \PhpAot\Core\Translator $type = $expr->getType(); switch ($type) { case 'Scalar_Int': - return $expr->value . 'L'; + return $expr->value . ($this->isMacos() ? 'LL' : 'L'); case 'Scalar_Float': return $this->parseScalarFloat($expr); case 'Scalar_String':