xref: /php-ast/tests/unary_ops.phpt (revision 260678d4)
1--TEST--
2Convert unary ops AST_(SILENCE|UNARY_(PLUS|MINUS)) to flags of ZEND_AST_UNARY_OP
3--FILE--
4<?php
5
6require __DIR__ . '/../util.php';
7
8$code = <<<'PHP'
9<?php
10@$a;
11+1;
12-1;
13PHP;
14
15echo ast_dump(ast\parse_code($code, $version=70)), "\n";
16
17?>
18--EXPECT--
19AST_STMT_LIST
20    0: AST_UNARY_OP
21        flags: UNARY_SILENCE (260)
22        expr: AST_VAR
23            name: "a"
24    1: AST_UNARY_OP
25        flags: UNARY_PLUS (261)
26        expr: 1
27    2: AST_UNARY_OP
28        flags: UNARY_MINUS (262)
29        expr: 1