1New in initializers
2-----
3<?php
4
5const C = new Foo;
6
7function a($x = new Foo) {
8    static $y = new Foo;
9}
10
11#[Attr(new Foo)]
12class Bar {
13    const C = new Foo;
14    public $prop = new Foo;
15}
16-----
17array(
18    0: Stmt_Const(
19        consts: array(
20            0: Const(
21                name: Identifier(
22                    name: C
23                )
24                value: Expr_New(
25                    class: Name(
26                        name: Foo
27                    )
28                    args: array(
29                    )
30                )
31            )
32        )
33    )
34    1: Stmt_Function(
35        attrGroups: array(
36        )
37        byRef: false
38        name: Identifier(
39            name: a
40        )
41        params: array(
42            0: Param(
43                attrGroups: array(
44                )
45                flags: 0
46                type: null
47                byRef: false
48                variadic: false
49                var: Expr_Variable(
50                    name: x
51                )
52                default: Expr_New(
53                    class: Name(
54                        name: Foo
55                    )
56                    args: array(
57                    )
58                )
59                hooks: array(
60                )
61            )
62        )
63        returnType: null
64        stmts: array(
65            0: Stmt_Static(
66                vars: array(
67                    0: StaticVar(
68                        var: Expr_Variable(
69                            name: y
70                        )
71                        default: Expr_New(
72                            class: Name(
73                                name: Foo
74                            )
75                            args: array(
76                            )
77                        )
78                    )
79                )
80            )
81        )
82    )
83    2: Stmt_Class(
84        attrGroups: array(
85            0: AttributeGroup(
86                attrs: array(
87                    0: Attribute(
88                        name: Name(
89                            name: Attr
90                        )
91                        args: array(
92                            0: Arg(
93                                name: null
94                                value: Expr_New(
95                                    class: Name(
96                                        name: Foo
97                                    )
98                                    args: array(
99                                    )
100                                )
101                                byRef: false
102                                unpack: false
103                            )
104                        )
105                    )
106                )
107            )
108        )
109        flags: 0
110        name: Identifier(
111            name: Bar
112        )
113        extends: null
114        implements: array(
115        )
116        stmts: array(
117            0: Stmt_ClassConst(
118                attrGroups: array(
119                )
120                flags: 0
121                type: null
122                consts: array(
123                    0: Const(
124                        name: Identifier(
125                            name: C
126                        )
127                        value: Expr_New(
128                            class: Name(
129                                name: Foo
130                            )
131                            args: array(
132                            )
133                        )
134                    )
135                )
136            )
137            1: Stmt_Property(
138                attrGroups: array(
139                )
140                flags: PUBLIC (1)
141                type: null
142                props: array(
143                    0: PropertyItem(
144                        name: VarLikeIdentifier(
145                            name: prop
146                        )
147                        default: Expr_New(
148                            class: Name(
149                                name: Foo
150                            )
151                            args: array(
152                            )
153                        )
154                    )
155                )
156                hooks: array(
157                )
158            )
159        )
160    )
161)
162