1Union types
2-----
3<?php
4
5class Test {
6    public A|iterable|null $prop;
7}
8
9function test(A|B $a): int|false {}
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_Property(
24                attrGroups: array(
25                )
26                flags: PUBLIC (1)
27                type: UnionType(
28                    types: array(
29                        0: Name(
30                            name: A
31                        )
32                        1: Identifier(
33                            name: iterable
34                        )
35                        2: Identifier(
36                            name: null
37                        )
38                    )
39                )
40                props: array(
41                    0: PropertyItem(
42                        name: VarLikeIdentifier(
43                            name: prop
44                        )
45                        default: null
46                    )
47                )
48                hooks: array(
49                )
50            )
51        )
52    )
53    1: Stmt_Function(
54        attrGroups: array(
55        )
56        byRef: false
57        name: Identifier(
58            name: test
59        )
60        params: array(
61            0: Param(
62                attrGroups: array(
63                )
64                flags: 0
65                type: UnionType(
66                    types: array(
67                        0: Name(
68                            name: A
69                        )
70                        1: Name(
71                            name: B
72                        )
73                    )
74                )
75                byRef: false
76                variadic: false
77                var: Expr_Variable(
78                    name: a
79                )
80                default: null
81                hooks: array(
82                )
83            )
84        )
85        returnType: UnionType(
86            types: array(
87                0: Identifier(
88                    name: int
89                )
90                1: Identifier(
91                    name: false
92                )
93            )
94        )
95        stmts: array(
96        )
97    )
98)
99