diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index daf94763..173a14c3 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -2202,8 +2202,8 @@ class CompilerBase extends \PhpAot\Core\Translator $libraries[] = 'gmp.lib'; $libraries[] = 'gmpxx.lib'; $libraries[] = 'mpfr.lib'; - $libraries[] = 'libmpdec.lib'; - $libraries[] = 'libmpdec++.lib'; + $libraries[] = 'libmpdec-4.0.1.dll.lib'; + $libraries[] = 'libmpdec++-4.0.1.dll.lib'; } else { // Linux/macOS: extension 和 bin 模式都需要添加 php 库 $libraries[] = 'php'; diff --git a/src/Php/Generator/TypeCheckGenerator.php b/src/Php/Generator/TypeCheckGenerator.php index 31b14dbf..1c8e4843 100644 --- a/src/Php/Generator/TypeCheckGenerator.php +++ b/src/Php/Generator/TypeCheckGenerator.php @@ -139,8 +139,8 @@ trait TypeCheckGenerator $orExpr = implode(' || ', $conditions); $fnName = $this->functionDef->getNamespacedName(); - $msgExpr = 'php::concat(php::concat(php::Str("' . $fnName . '(): Argument #' . ($argIndex + 1) - . ' ($' . $varName . ') must be of type ' . $argInfo->typeStr . ', "), ' + $msgExpr = 'php::concat(php::concat(php::Str(' . $this->genCharPtr($fnName, true) . ' "(): Argument #' . ($argIndex + 1) + . ' ($' . $varName . ') must be of type " ' . $this->genCharPtr($argInfo->typeStr, true) . ' ", "), ' . $varName . '.typeStr()), php::Str(" given"))'; $code = $this->getIndent() . 'if (UNEXPECTED(!(' . $orExpr . '))) {' . PHP_EOL; @@ -174,8 +174,8 @@ trait TypeCheckGenerator $fnName = $this->functionDef->getNamespacedName(); $typeStr = $this->functionDef->returnTypeStr; - $msgExpr = 'php::concat(php::concat(php::Str("' . $fnName . '(): Return value must be of type ' - . $typeStr . ', "), ' . $varName . '.typeStr()), php::Str(" given"))'; + $msgExpr = 'php::concat(php::concat(php::Str(' . $this->genCharPtr($fnName, true) . ' "(): Return value must be of type " ' + . $this->genCharPtr($typeStr, true) . ' ", "), ' . $varName . '.typeStr()), php::Str(" given"))'; $code = $this->getIndent() . 'if (UNEXPECTED(!(' . $orExpr . '))) {' . PHP_EOL; $this->indentLevel++;