xref: /php-ast/tests/eval_include.phpt (revision 91f59467)
1--TEST--
2eval() and include parsing
3--FILE--
4<?php
5
6require __DIR__ . '/../util.php';
7
8$code = <<<'PHP'
9<?php
10eval( 'echo "hello";');
11include 'foo.php';
12include_once 'foo.php';
13require 'foo.php';
14require_once 'foo.php';
15PHP;
16
17echo ast_dump(ast\parse_code($code, $version=70));
18
19?>
20--EXPECT--
21AST_STMT_LIST
22    0: AST_INCLUDE_OR_EVAL
23        flags: EXEC_EVAL (1)
24        expr: "echo "hello";"
25    1: AST_INCLUDE_OR_EVAL
26        flags: EXEC_INCLUDE (2)
27        expr: "foo.php"
28    2: AST_INCLUDE_OR_EVAL
29        flags: EXEC_INCLUDE_ONCE (4)
30        expr: "foo.php"
31    3: AST_INCLUDE_OR_EVAL
32        flags: EXEC_REQUIRE (8)
33        expr: "foo.php"
34    4: AST_INCLUDE_OR_EVAL
35        flags: EXEC_REQUIRE_ONCE (16)
36        expr: "foo.php"
37