1--TEST--
2'??=' operator 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$x ??= 2;
13Foo::$prop['offset'] ??= $other ??= 'value';
14PHP;
15
16$node = ast\parse_code($code, $version=70);
17echo ast_dump($node), "\n";
18?>
19--EXPECTF--
20AST_STMT_LIST
21    0: AST_ASSIGN_OP
22        flags: BINARY_COALESCE (%d)
23        var: AST_VAR
24            name: "x"
25        expr: 2
26    1: AST_ASSIGN_OP
27        flags: BINARY_COALESCE (%d)
28        var: AST_DIM
29            expr: AST_STATIC_PROP
30                class: AST_NAME
31                    flags: NAME_NOT_FQ (%d)
32                    name: "Foo"
33                prop: "prop"
34            dim: "offset"
35        expr: AST_ASSIGN_OP
36            flags: BINARY_COALESCE (%d)
37            var: AST_VAR
38                name: "other"
39            expr: "value"