diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index ebcb034f..f447b905 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -837,6 +837,8 @@ class CompilerBase extends \PhpAot\Core\Translator $this->climate->cyan('Skip function ' . $name); } $this->indentLevel--; + } else { + $stmts = $this->genReturnCode(); } $functionDeclCode = $this->getReturnType() . ' ' . self::PREFIX . $name . '('; diff --git a/tests/aot/type_decl/005.phpt b/tests/aot/type_decl/005.phpt new file mode 100644 index 00000000..a602c80b --- /dev/null +++ b/tests/aot/type_decl/005.phpt @@ -0,0 +1,14 @@ +--TEST-- +Type Declarations +--FILE-- + +--EXPECT-- +string(4) "main"