1--TEST-- 2Class properties in AST version 70 3--FILE-- 4<?php 5 6require __DIR__ . '/../util.php'; 7 8$code = <<<'PHP' 9<?php 10namespace Foo; 11echo Bar::class, 12namespace\Bat::class, 13Bat::class_, // this is a regular class constant 14\Baz::CLASS; 15echo []::class; // this is a runtime error, not a syntax error 16echo 'foo'::class; // this is valid but rare 17echo (new \stdClass())::class; // this is a runtime error, not a syntax error 18PHP; 19 20$node = ast\parse_code($code, $version=70); 21echo ast_dump($node), "\n"; 22?> 23--EXPECTF-- 24AST_STMT_LIST 25 0: AST_NAMESPACE 26 name: "Foo" 27 stmts: null 28 1: AST_ECHO 29 expr: AST_CLASS_NAME 30 class: AST_NAME 31 flags: NAME_NOT_FQ (%d) 32 name: "Bar" 33 2: AST_ECHO 34 expr: AST_CLASS_NAME 35 class: AST_NAME 36 flags: NAME_RELATIVE (%d) 37 name: "Bat" 38 3: AST_ECHO 39 expr: AST_CLASS_CONST 40 class: AST_NAME 41 flags: NAME_NOT_FQ (%d) 42 name: "Bat" 43 const: "class_" 44 4: AST_ECHO 45 expr: AST_CLASS_NAME 46 class: AST_NAME 47 flags: NAME_FQ (%d) 48 name: "Baz" 49 5: AST_ECHO 50 expr: AST_CLASS_NAME 51 class: AST_ARRAY 52 flags: %s 53 6: AST_ECHO 54 expr: AST_CLASS_NAME 55 class: AST_NAME 56 flags: NAME_FQ (%d) 57 name: "foo" 58 7: AST_ECHO 59 expr: AST_CLASS_NAME 60 class: AST_NEW 61 class: AST_NAME 62 flags: NAME_FQ (0) 63 name: "stdClass" 64 args: AST_ARG_LIST 65