1--TEST--
2Nested arrow functions in PHP 7.4
3--SKIPIF--
4<?php if (PHP_VERSION_ID < 70400) die('skip PHP >= 7.4 only'); ?>
5--FILE--
6<?php
7
8require __DIR__ . '/../util.php';
9
10$code = <<<'PHP'
11<?php
12$cb = fn() => fn() => $undef;
13PHP;
14
15$node = ast\parse_code($code, $version=85);
16echo ast_dump($node) . "\n";
17?>
18--EXPECT--
19AST_STMT_LIST
20    0: AST_ASSIGN
21        var: AST_VAR
22            name: "cb"
23        expr: AST_ARROW_FUNC
24            name: "{closure}"
25            docComment: null
26            params: AST_PARAM_LIST
27            stmts: AST_RETURN
28                expr: AST_ARROW_FUNC
29                    name: "{closure}"
30                    docComment: null
31                    params: AST_PARAM_LIST
32                    stmts: AST_RETURN
33                        expr: AST_VAR
34                            name: "undef"
35                    returnType: null
36                    attributes: null
37                    __declId: 0
38            returnType: null
39            attributes: null
40            __declId: 1