1--TEST-- 2Readonly properties in php 8.1 3--SKIPIF-- 4<?php if (PHP_VERSION_ID < 80100) die('skip PHP >= 8.1 only'); ?> 5--FILE-- 6<?php 7 8require __DIR__ . '/../util.php'; 9 10$code = <<<'PHP' 11<?php 12class X { 13 public readonly int $var; 14} 15PHP; 16 17$node = ast\parse_code($code, $version=60); 18echo ast_dump($node), "\n"; 19$node = ast\parse_code($code, $version=85); 20echo ast_dump($node), "\n"; 21--EXPECTF-- 22AST_STMT_LIST 23 0: AST_CLASS 24 flags: 0 25 name: "X" 26 docComment: null 27 extends: null 28 implements: null 29 stmts: AST_STMT_LIST 30 0: AST_PROP_DECL 31 flags: MODIFIER_PUBLIC | MODIFIER_READONLY (%d) 32 0: AST_PROP_ELEM 33 name: "var" 34 default: null 35 docComment: null 36 __declId: 0 37AST_STMT_LIST 38 0: AST_CLASS 39 flags: 0 40 name: "X" 41 docComment: null 42 extends: null 43 implements: null 44 stmts: AST_STMT_LIST 45 0: AST_PROP_GROUP 46 flags: MODIFIER_PUBLIC | MODIFIER_READONLY (%d) 47 type: AST_TYPE 48 flags: TYPE_LONG (%d) 49 props: AST_PROP_DECL 50 flags: 0 51 0: AST_PROP_ELEM 52 name: "var" 53 default: null 54 docComment: null 55 attributes: null 56 attributes: null 57 type: null 58 __declId: 0