Mercurial > hg > isophonics-drupal-site
comparison vendor/nikic/php-parser/test/code/parser/stmt/function/defaultValues.test @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 5fb285c0d0e3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 Default values (static scalar tests) | |
2 ----- | |
3 <?php | |
4 | |
5 function 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 ----- | |
17 array( | |
18 0: Stmt_Function( | |
19 byRef: false | |
20 name: a | |
21 params: array( | |
22 0: Param( | |
23 type: null | |
24 byRef: false | |
25 variadic: false | |
26 name: b | |
27 default: Expr_ConstFetch( | |
28 name: Name( | |
29 parts: array( | |
30 0: null | |
31 ) | |
32 ) | |
33 ) | |
34 ) | |
35 1: Param( | |
36 type: null | |
37 byRef: false | |
38 variadic: false | |
39 name: c | |
40 default: Scalar_String( | |
41 value: foo | |
42 ) | |
43 ) | |
44 2: Param( | |
45 type: null | |
46 byRef: false | |
47 variadic: false | |
48 name: d | |
49 default: Expr_ClassConstFetch( | |
50 class: Name( | |
51 parts: array( | |
52 0: A | |
53 ) | |
54 ) | |
55 name: B | |
56 ) | |
57 ) | |
58 3: Param( | |
59 type: null | |
60 byRef: false | |
61 variadic: false | |
62 name: f | |
63 default: Expr_UnaryPlus( | |
64 expr: Scalar_LNumber( | |
65 value: 1 | |
66 ) | |
67 ) | |
68 ) | |
69 4: Param( | |
70 type: null | |
71 byRef: false | |
72 variadic: false | |
73 name: g | |
74 default: Expr_UnaryMinus( | |
75 expr: Scalar_DNumber( | |
76 value: 1 | |
77 ) | |
78 ) | |
79 ) | |
80 5: Param( | |
81 type: null | |
82 byRef: false | |
83 variadic: false | |
84 name: h | |
85 default: Expr_Array( | |
86 items: array( | |
87 ) | |
88 ) | |
89 ) | |
90 6: Param( | |
91 type: null | |
92 byRef: false | |
93 variadic: false | |
94 name: i | |
95 default: Expr_Array( | |
96 items: array( | |
97 ) | |
98 ) | |
99 ) | |
100 7: Param( | |
101 type: null | |
102 byRef: false | |
103 variadic: false | |
104 name: j | |
105 default: Expr_Array( | |
106 items: array( | |
107 0: Expr_ArrayItem( | |
108 key: null | |
109 value: Scalar_String( | |
110 value: foo | |
111 ) | |
112 byRef: false | |
113 ) | |
114 ) | |
115 ) | |
116 ) | |
117 8: Param( | |
118 type: null | |
119 byRef: false | |
120 variadic: false | |
121 name: k | |
122 default: Expr_Array( | |
123 items: array( | |
124 0: Expr_ArrayItem( | |
125 key: null | |
126 value: Scalar_String( | |
127 value: foo | |
128 ) | |
129 byRef: false | |
130 ) | |
131 1: Expr_ArrayItem( | |
132 key: Scalar_String( | |
133 value: bar | |
134 ) | |
135 value: Scalar_String( | |
136 value: baz | |
137 ) | |
138 byRef: false | |
139 ) | |
140 ) | |
141 ) | |
142 ) | |
143 ) | |
144 returnType: null | |
145 stmts: array( | |
146 ) | |
147 ) | |
148 ) |