2
2
AST pretty-peinter
3
3
--INI--
4
4
zend.assertions=1
5
- assert.exception=0
6
5
--FILE--
7
6
<?php
7
+ try {
8
8
assert (0 && ($ a = function () {
9
9
global $ a , $ $ b ;
10
10
static $ c , $ d = 0 ;
@@ -19,7 +19,11 @@ assert(0 && ($a = function () {
19
19
yield 1 => 2 ;
20
20
yield from $ x ;
21
21
}));
22
+ } catch (AssertionError $ e ) {
23
+ echo $ e ->getMessage (), PHP_EOL ;
24
+ }
22
25
26
+ try {
23
27
assert (0 && ($ a = function &(array &$ a , ?X $ b = null ) use ($ c ,&$ d ) : ?X {
24
28
abstract class A extends B implements C, D {
25
29
const X = 12 ;
@@ -64,7 +68,11 @@ assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
64
68
}
65
69
}
66
70
}));
71
+ } catch (AssertionError $ e ) {
72
+ echo $ e ->getMessage (), PHP_EOL ;
73
+ }
67
74
75
+ try {
68
76
assert (0 && ($ a = function &(array &$ a , X $ b = null , int |float $ c ) use ($ c ,&$ d ) : X {
69
77
final class A {
70
78
final protected function f2 () {
96
104
}
97
105
}
98
106
}));
107
+ } catch (AssertionError $ e ) {
108
+ echo $ e ->getMessage (), PHP_EOL ;
109
+ }
99
110
111
+ try {
100
112
assert (0 && ($ a = function &(?array &$ a , X $ b = null ) use ($ c ,&$ d ) : X {
101
113
class A {
102
114
use T1 , T2 {
@@ -108,7 +120,11 @@ assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
108
120
use T3 ;
109
121
}
110
122
}));
123
+ } catch (AssertionError $ e ) {
124
+ echo $ e ->getMessage (), PHP_EOL ;
125
+ }
111
126
127
+ try {
112
128
assert (0 && ($ a = function &(array &...$ a ) {
113
129
declare (A=1 ,B=2 );
114
130
try {
@@ -121,7 +137,11 @@ assert(0 && ($a = function &(array &...$a) {
121
137
echo 3 ;
122
138
}
123
139
}));
140
+ } catch (AssertionError $ e ) {
141
+ echo $ e ->getMessage (), PHP_EOL ;
142
+ }
124
143
144
+ try {
125
145
assert (0 && ($ a = function (): ?static {
126
146
declare (C=1 ) { echo 1 ; }
127
147
$ x = '\'"`$a ' ;
@@ -145,10 +165,13 @@ assert(0 && ($a = function (): ?static {
145
165
}
146
166
if ($ a ); else ;
147
167
}));
168
+ } catch (AssertionError $ e ) {
169
+ echo $ e ->getMessage (), PHP_EOL ;
170
+ }
148
171
149
172
?>
150
- --EXPECTF --
151
- Warning: assert(): assert(0 && ($a = function () {
173
+ --EXPECT --
174
+ assert(0 && ($a = function () {
152
175
global $a;
153
176
global $$b;
154
177
static $c;
@@ -163,9 +186,8 @@ Warning: assert(): assert(0 && ($a = function () {
163
186
$y = clone $x;
164
187
yield 1 => 2;
165
188
yield from $x;
166
- })) failed in %s on line %d
167
-
168
- Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
189
+ }))
190
+ assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X {
169
191
abstract class A extends B implements C, D {
170
192
public const X = 12;
171
193
public const Y = self::X, Z = 'aaa';
@@ -208,9 +230,8 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c,
208
230
209
231
}
210
232
211
- })) failed in %s on line %d
212
-
213
- Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X {
233
+ }))
234
+ assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X {
214
235
final class A {
215
236
protected final function f2() {
216
237
if (!$x) {
@@ -248,9 +269,8 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null, int|floa
248
269
249
270
}
250
271
251
- })) failed in %s on line %d
252
-
253
- Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
272
+ }))
273
+ assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
254
274
class A {
255
275
use T1, T2 {
256
276
T1::foo insteadof foo;
@@ -261,9 +281,8 @@ Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c,
261
281
use T3;
262
282
}
263
283
264
- })) failed in %s on line %d
265
-
266
- Warning: assert(): assert(0 && ($a = function &(array &...$a) {
284
+ }))
285
+ assert(0 && ($a = function &(array &...$a) {
267
286
declare(A = 1, B = 2);
268
287
try {
269
288
$i++;
@@ -274,9 +293,8 @@ Warning: assert(): assert(0 && ($a = function &(array &...$a) {
274
293
} finally {
275
294
echo 3;
276
295
}
277
- })) failed in %s on line %d
278
-
279
- Warning: assert(): assert(0 && ($a = function (): ?static {
296
+ }))
297
+ assert(0 && ($a = function (): ?static {
280
298
declare(C = 1) {
281
299
echo 1;
282
300
}
@@ -302,4 +320,4 @@ Warning: assert(): assert(0 && ($a = function (): ?static {
302
320
if ($a) {
303
321
} else {
304
322
}
305
- })) failed in %s on line %d
323
+ }))
0 commit comments