xref: /php-ast/tests/generator_flag.phpt (revision 91f59467)
1--TEST--
2Flag on generator functions
3--FILE--
4<?php
5
6require __DIR__ . '/../util.php';
7
8$code = <<<'PHP'
9<?php
10function gen() {
11    yield;
12}
13PHP;
14
15echo ast_dump(ast\parse_code($code, $version=70)), "\n";
16
17?>
18--EXPECTF--
19AST_STMT_LIST
20    0: AST_FUNC_DECL
21        flags: FUNC_GENERATOR (%d)
22        name: "gen"
23        docComment: null
24        params: AST_PARAM_LIST
25        stmts: AST_STMT_LIST
26            0: AST_YIELD
27                value: null
28                key: null
29        returnType: null
30        __declId: 0
31