diff --git a/src/Php/Context/FunctionContext.php b/src/Php/Context/FunctionContext.php index 66ac809b..7be2630a 100644 --- a/src/Php/Context/FunctionContext.php +++ b/src/Php/Context/FunctionContext.php @@ -96,7 +96,7 @@ class FunctionContext public function leaveScope(): void { - unset($this->scopeLayouts[$this->scopeLevel]); $this->scopeLevel--; + unset($this->scopeLayouts[$this->scopeLevel]); } } diff --git a/src/Php/Parser/TypeConversionTrait.php b/src/Php/Parser/TypeConversionTrait.php index 0dcd897b..cec3d0b8 100644 --- a/src/Php/Parser/TypeConversionTrait.php +++ b/src/Php/Parser/TypeConversionTrait.php @@ -76,7 +76,7 @@ trait TypeConversionTrait return 'php::toBigInt(' . $this->trimBrackets($expr) . ')'; } if ($fromType === self::TYPE_FLOAT) { - $this->fatalError(null, 'Cannot convert float to BigInt, use string or int instead'); + $this->error('Cannot convert float to BigInt, use string or int instead'); } if ($fromType === self::TYPE_STR) { return 'php::toBigInt(php::toString(' . $this->trimBrackets($expr) . '))'; diff --git a/src/Php/Parser/TypeDetectionTrait.php b/src/Php/Parser/TypeDetectionTrait.php index 84d917e3..8005dc41 100644 --- a/src/Php/Parser/TypeDetectionTrait.php +++ b/src/Php/Parser/TypeDetectionTrait.php @@ -138,7 +138,7 @@ trait TypeDetectionTrait protected function isArrayVar($var): bool { - return $this->isVarExpr($var) and $this->hasVar($var->name) and $this->getVarType($var->name) == self::TYPE_ARRAY; + return $this->isVarExpr($var) and $this->hasVar($var->name) and $this->getVarType($var->name) === self::TYPE_ARRAY; } }