diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index a5e4a125..491a89f5 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -1500,7 +1500,8 @@ class CompilerBase extends \PhpAot\Core\Translator $argClass = $expr->args[1]->value; if ($this->isScalarString($argClass)) { return $this->getNamespacedClassName($this->parseIdentifier($argClass)); - } elseif ($this->isClassConstFetch($argClass)) { + } + if ($this->isClassConstFetch($argClass)) { if ($this->isNameExpr($argClass->class) and $this->isIdExpr($argClass->name) and $this->parseIdentifier($argClass->name) === 'class') { return $this->getNamespacedClassName($this->parseIdentifier($argClass->class)); } @@ -1516,7 +1517,8 @@ class CompilerBase extends \PhpAot\Core\Translator if ($nativeFunc) { return $this->getFunction($nativeFunc)->returnClass; } - } catch (DynamicCall) {} + } catch (DynamicCall) { + } } if ($this->isStaticCall($expr) and $this->isNameExpr($expr->class) and $this->isNamedMethod($expr->name)) { $class = $this->parseIdentifier($expr->class); @@ -4045,7 +4047,7 @@ class CompilerBase extends \PhpAot\Core\Translator $fn = 'php::concat({' . $this->identifierToStr($expr->class) . ', "::", ' . $this->identifierToStr($expr->name) . '})'; } $placeHolder = $fn; - } elseif ($class === 'static') { + } elseif ($this->isNameExpr($expr->class) and $class === 'static') { $methodPtr = $this->identifierToStr($expr->name, literal: true); $fn = Symbol::getCalledCe() . ', php::getMethod(' . Symbol::getCalledCe() . ', ' . $methodPtr . ')'; $this->context->beforeStmtLines[] = '// Static Method Call: static::' . $this->parseIdentifier($expr->name) . '()'; diff --git a/src/Php/Translator.php b/src/Php/Translator.php index 4c9e2a50..794ad162 100644 --- a/src/Php/Translator.php +++ b/src/Php/Translator.php @@ -591,7 +591,7 @@ class Translator extends Preprocessor } } elseif (is_float($value)) { return $value; - } else if (is_bool($value)) { + } elseif (is_bool($value)) { return $value ? 1 : 0; } elseif (is_string($value)) { return $this->genCharPtr($value);