1Default values (static scalar tests)
2-----
3<?php
4
5function a(
6    $b = null,
7    $c = 'foo',
8    $d = A::B,
9    $f = +1,
10    $g = -1.0,
11    $h = array(),
12    $i = [],
13    $j = ['foo'],
14    $k = ['foo', 'bar' => 'baz']
15) {}
16-----
17array(
18    0: Stmt_Function(
19        attrGroups: array(
20        )
21        byRef: false
22        name: Identifier(
23            name: a
24        )
25        params: array(
26            0: Param(
27                attrGroups: array(
28                )
29                flags: 0
30                type: null
31                byRef: false
32                variadic: false
33                var: Expr_Variable(
34                    name: b
35                )
36                default: Expr_ConstFetch(
37                    name: Name(
38                        name: null
39                    )
40                )
41                hooks: array(
42                )
43            )
44            1: Param(
45                attrGroups: array(
46                )
47                flags: 0
48                type: null
49                byRef: false
50                variadic: false
51                var: Expr_Variable(
52                    name: c
53                )
54                default: Scalar_String(
55                    value: foo
56                )
57                hooks: array(
58                )
59            )
60            2: Param(
61                attrGroups: array(
62                )
63                flags: 0
64                type: null
65                byRef: false
66                variadic: false
67                var: Expr_Variable(
68                    name: d
69                )
70                default: Expr_ClassConstFetch(
71                    class: Name(
72                        name: A
73                    )
74                    name: Identifier(
75                        name: B
76                    )
77                )
78                hooks: array(
79                )
80            )
81            3: Param(
82                attrGroups: array(
83                )
84                flags: 0
85                type: null
86                byRef: false
87                variadic: false
88                var: Expr_Variable(
89                    name: f
90                )
91                default: Expr_UnaryPlus(
92                    expr: Scalar_Int(
93                        value: 1
94                    )
95                )
96                hooks: array(
97                )
98            )
99            4: Param(
100                attrGroups: array(
101                )
102                flags: 0
103                type: null
104                byRef: false
105                variadic: false
106                var: Expr_Variable(
107                    name: g
108                )
109                default: Expr_UnaryMinus(
110                    expr: Scalar_Float(
111                        value: 1
112                    )
113                )
114                hooks: array(
115                )
116            )
117            5: Param(
118                attrGroups: array(
119                )
120                flags: 0
121                type: null
122                byRef: false
123                variadic: false
124                var: Expr_Variable(
125                    name: h
126                )
127                default: Expr_Array(
128                    items: array(
129                    )
130                )
131                hooks: array(
132                )
133            )
134            6: Param(
135                attrGroups: array(
136                )
137                flags: 0
138                type: null
139                byRef: false
140                variadic: false
141                var: Expr_Variable(
142                    name: i
143                )
144                default: Expr_Array(
145                    items: array(
146                    )
147                )
148                hooks: array(
149                )
150            )
151            7: Param(
152                attrGroups: array(
153                )
154                flags: 0
155                type: null
156                byRef: false
157                variadic: false
158                var: Expr_Variable(
159                    name: j
160                )
161                default: Expr_Array(
162                    items: array(
163                        0: ArrayItem(
164                            key: null
165                            value: Scalar_String(
166                                value: foo
167                            )
168                            byRef: false
169                            unpack: false
170                        )
171                    )
172                )
173                hooks: array(
174                )
175            )
176            8: Param(
177                attrGroups: array(
178                )
179                flags: 0
180                type: null
181                byRef: false
182                variadic: false
183                var: Expr_Variable(
184                    name: k
185                )
186                default: Expr_Array(
187                    items: array(
188                        0: ArrayItem(
189                            key: null
190                            value: Scalar_String(
191                                value: foo
192                            )
193                            byRef: false
194                            unpack: false
195                        )
196                        1: ArrayItem(
197                            key: Scalar_String(
198                                value: bar
199                            )
200                            value: Scalar_String(
201                                value: baz
202                            )
203                            byRef: false
204                            unpack: false
205                        )
206                    )
207                )
208                hooks: array(
209                )
210            )
211        )
212        returnType: null
213        stmts: array(
214        )
215    )
216)
217