0ac423901b2c2756562f4898708596d94bc4cb25
[yaffs-website] / vendor / nikic / php-parser / test / code / formatPreservation / listRemoval.test
1 Removing from list nodes
2 -----
3 <?php $foo; $bar; $baz;
4 -----
5 array_splice($stmts, 1, 1, []);
6 -----
7 <?php $foo; $baz;
8 -----
9 <?php
10 function foo(
11     $a,
12     $b,
13     $c
14 ) {}
15 -----
16 array_pop($stmts[0]->params);
17 -----
18 <?php
19 function foo(
20     $a,
21     $b
22 ) {}
23 -----
24 <?php
25 function foo(
26     $a,
27     $b,
28     $c
29 ) {}
30 -----
31 array_pop($stmts[0]->params);
32 $stmts[0]->params[] = new Node\Param(new Expr\Variable('x'));
33 $stmts[0]->params[] = new Node\Param(new Expr\Variable('y'));
34 -----
35 <?php
36 function foo(
37     $a,
38     $b,
39     $x,
40     $y
41 ) {}