Removed modules/contrib/media module to allow update to the core media module
[yaffs-website] / vendor / nikic / php-parser / test / code / formatPreservation / removalViaNull.test
1 Removing subnodes by setting them to null
2 -----
3 <?php
4 function
5 foo (
6     Bar $foo
7         = null,
8     Foo $bar) : baz
9 {}
10
11 function
12 ()
13 : int
14 {};
15
16 class
17 Foo
18 extends
19 Bar
20 {
21     public
22     function
23     foo() : ?X {}
24
25     public
26       $prop = 'x'
27     ;
28
29     use T {
30         T
31         ::
32         x
33         as
34         public
35         y
36         ;
37     }
38 }
39
40 $foo [ $bar ];
41 exit ( $bar );
42 $foo
43 ? $bar :
44 $baz;
45 [ $a => $b
46 , $c => $d];
47
48 yield
49 $foo
50 =>
51 $bar;
52 yield
53 $bar;
54
55 break
56 2
57 ;
58 continue
59 2
60 ;
61
62 foreach(
63     $array
64 as
65     $key
66  =>
67     $value
68 ) {}
69
70 if
71 ($x)
72 {
73 }
74
75 else {}
76
77 return
78 $val
79 ;
80 static
81   $x
82   =
83   $y
84 ;
85
86 try {} catch
87   (X $y)
88   {}
89 finally
90 {}
91 -----
92 $stmts[0]->returnType = null;
93 $stmts[0]->params[0]->default = null;
94 $stmts[0]->params[1]->type = null;
95 $stmts[1]->expr->returnType = null;
96 $stmts[2]->extends = null;
97 $stmts[2]->stmts[0]->returnType = null;
98 $stmts[2]->stmts[1]->props[0]->default = null;
99 $stmts[2]->stmts[2]->adaptations[0]->newName = null;
100 $stmts[3]->expr->dim = null;
101 $stmts[4]->expr->expr = null;
102 $stmts[5]->expr->if = null;
103 $stmts[6]->expr->items[1]->key = null;
104 $stmts[7]->expr->key = null;
105 $stmts[8]->expr->value = null;
106 $stmts[9]->num = null;
107 $stmts[10]->num = null;
108 $stmts[11]->keyVar = null;
109 $stmts[12]->else = null;
110 $stmts[13]->expr = null;
111 $stmts[14]->vars[0]->default = null;
112 $stmts[15]->finally = null;
113 -----
114 <?php
115 function
116 foo (
117     Bar $foo,
118     $bar)
119 {}
120
121 function
122 ()
123 {};
124
125 class
126 Foo
127 {
128     public
129     function
130     foo() {}
131
132     public
133       $prop
134     ;
135
136     use T {
137         T
138         ::
139         x
140         as
141         public
142         ;
143     }
144 }
145
146 $foo [];
147 exit ();
148 $foo
149 ?:
150 $baz;
151 [ $a => $b
152 , $d];
153
154 yield
155 $bar;
156 yield;
157
158 break;
159 continue;
160
161 foreach(
162     $array
163 as
164     $value
165 ) {}
166
167 if
168 ($x)
169 {
170 }
171
172 return;
173 static
174   $x
175 ;
176
177 try {} catch
178   (X $y)
179   {}
180 -----
181 <?php
182
183 namespace
184 A
185     {
186     }
187 -----
188 $stmts[0]->name = null;
189 -----
190 <?php
191
192 namespace
193     {
194     }