1--TEST--
2Non-capturing catches in PHP 8.0
3--SKIPIF--
4<?php if (PHP_VERSION_ID < 80000) die('skip PHP >= 8.0 only'); ?>
5--FILE--
6<?php
7
8require __DIR__ . '/../util.php';
9
10$code = <<<'PHP'
11<?php
12try {
13	foo();
14} catch (Exception) {
15	echo "ignoring";
16}
17PHP;
18
19$node = ast\parse_code($code, $version=70);
20echo ast_dump($node), "\n";
21--EXPECTF--
22AST_STMT_LIST
23    0: AST_TRY
24        try: AST_STMT_LIST
25            0: AST_CALL
26                expr: AST_NAME
27                    flags: NAME_NOT_FQ (1)
28                    name: "foo"
29                args: AST_ARG_LIST
30        catches: AST_CATCH_LIST
31            0: AST_CATCH
32                class: AST_NAME_LIST
33                    0: AST_NAME
34                        flags: NAME_NOT_FQ (1)
35                        name: "Exception"
36                var: null
37                stmts: AST_STMT_LIST
38                    0: AST_ECHO
39                        expr: "ignoring"
40        finally: null
41