diff --git a/bin/gen_stub.php b/bin/gen_stub.php index 6014fedb..09c28178 100755 --- a/bin/gen_stub.php +++ b/bin/gen_stub.php @@ -4581,6 +4581,7 @@ class DocCommentTag { /** @return DocCommentTag[] */ public static function parseDocComments(array $comments): array { + return []; $tags = []; foreach ($comments as $comment) { if (!($comment instanceof DocComment)) { diff --git a/src/Php/Preprocessor.php b/src/Php/Preprocessor.php index 92ea303c..ae554aab 100644 --- a/src/Php/Preprocessor.php +++ b/src/Php/Preprocessor.php @@ -112,6 +112,7 @@ class Preprocessor extends CompilerBase case 'Stmt_Use': case 'Stmt_Const': case 'Stmt_Interface': + case 'Stmt_Nop': break; default: $this->fatalError($v, 'Unsupported statement: ' . $type); diff --git a/src/Php/Translator.php b/src/Php/Translator.php index 07c2feaa..49a7b877 100644 --- a/src/Php/Translator.php +++ b/src/Php/Translator.php @@ -232,6 +232,8 @@ class Translator extends Preprocessor case 'Stmt_Interface': $this->parseInterface($v) . PHP_EOL; break; + case 'Stmt_Nop': + break; default: abort($v); } diff --git a/tests/core/classes/class_abstract.phpt b/tests/core/classes/class_abstract.phpt new file mode 100644 index 00000000..e652019d --- /dev/null +++ b/tests/core/classes/class_abstract.phpt @@ -0,0 +1,32 @@ +--TEST-- +ZE2 An abstract class cannot be instantiated +--FILE-- +show(); + + $t = new base(); + $t->show(); + + echo "Done\n"; // shouldn't be displayed +} +?> +--EXPECTF-- +base + +Fatal error: Uncaught Error: Cannot instantiate abstract class base in %s:%d +Stack trace: +#0 Unknown(0) : %s +#1 {main} + thrown in %s on line %d