1Typed constants 2----- 3<?php 4class Test { 5 const int X = 1; 6 private const string Y = "a", Z = "b"; 7 const array ARRAY = []; 8 const Foo|Bar|null FOO = null; 9} 10----- 11array( 12 0: Stmt_Class( 13 attrGroups: array( 14 ) 15 flags: 0 16 name: Identifier( 17 name: Test 18 ) 19 extends: null 20 implements: array( 21 ) 22 stmts: array( 23 0: Stmt_ClassConst( 24 attrGroups: array( 25 ) 26 flags: 0 27 type: Identifier( 28 name: int 29 ) 30 consts: array( 31 0: Const( 32 name: Identifier( 33 name: X 34 ) 35 value: Scalar_Int( 36 value: 1 37 ) 38 ) 39 ) 40 ) 41 1: Stmt_ClassConst( 42 attrGroups: array( 43 ) 44 flags: PRIVATE (4) 45 type: Identifier( 46 name: string 47 ) 48 consts: array( 49 0: Const( 50 name: Identifier( 51 name: Y 52 ) 53 value: Scalar_String( 54 value: a 55 ) 56 ) 57 1: Const( 58 name: Identifier( 59 name: Z 60 ) 61 value: Scalar_String( 62 value: b 63 ) 64 ) 65 ) 66 ) 67 2: Stmt_ClassConst( 68 attrGroups: array( 69 ) 70 flags: 0 71 type: Identifier( 72 name: array 73 ) 74 consts: array( 75 0: Const( 76 name: Identifier( 77 name: ARRAY 78 ) 79 value: Expr_Array( 80 items: array( 81 ) 82 ) 83 ) 84 ) 85 ) 86 3: Stmt_ClassConst( 87 attrGroups: array( 88 ) 89 flags: 0 90 type: UnionType( 91 types: array( 92 0: Name( 93 name: Foo 94 ) 95 1: Name( 96 name: Bar 97 ) 98 2: Identifier( 99 name: null 100 ) 101 ) 102 ) 103 consts: array( 104 0: Const( 105 name: Identifier( 106 name: FOO 107 ) 108 value: Expr_ConstFetch( 109 name: Name( 110 name: null 111 ) 112 ) 113 ) 114 ) 115 ) 116 ) 117 ) 118) 119