xref: /php-ast/tests/coalesce.phpt (revision 260678d4)
1--TEST--
2Null-coalesce operator
3--FILE--
4<?php
5
6require __DIR__ . '/../util.php';
7
8$code = <<<'PHP'
9<?php
10$a ?? $b;
11PHP;
12
13echo ast_dump(ast\parse_code($code, $version=70)), "\n";
14
15?>
16--EXPECTF--
17AST_STMT_LIST
18    0: AST_BINARY_OP
19        flags: BINARY_COALESCE (%d)
20        left: AST_VAR
21            name: "a"
22        right: AST_VAR
23            name: "b"