1Inserting into an empty list
2-----
3<?php
4class
5Test {}
6
7interface
8Test {}
9-----
10$stmts[0]->implements[] = new Node\Name('Iface');
11$stmts[0]->implements[] = new Node\Name('Iface2');
12$stmts[1]->extends[] = new Node\Name('Iface');
13$stmts[1]->extends[] = new Node\Name('Iface2');
14-----
15<?php
16class
17Test implements Iface, Iface2 {}
18
19interface
20Test extends Iface, Iface2 {}
21-----
22<?php
23function test
24() {}
25
26class Test {
27    public function
28    test
29    () {}
30}
31
32function
33() {};
34
35fn()
36=> 42;
37-----
38$stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('a'));
39$stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('b'));
40$stmts[1]->stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('a'));
41$stmts[1]->stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('b'));
42$stmts[2]->expr->params[] = new Node\Param(new Node\Expr\Variable('a'));
43$stmts[2]->expr->params[] = new Node\Param(new Node\Expr\Variable('b'));
44$stmts[2]->expr->uses[] = new Node\Expr\Variable('c');
45$stmts[2]->expr->uses[] = new Node\Expr\Variable('d');
46$stmts[3]->expr->params[] = new Node\Param(new Node\Expr\Variable('a'));
47$stmts[3]->expr->params[] = new Node\Param(new Node\Expr\Variable('b'));
48-----
49<?php
50function test
51($a, $b) {}
52
53class Test {
54    public function
55    test
56    ($a, $b) {}
57}
58
59function
60($a, $b) use ($c, $d) {};
61
62fn($a, $b)
63=> 42;
64-----
65<?php
66foo
67();
68
69$foo->
70bar();
71
72Foo
73::bar ();
74
75new
76Foo
77();
78
79new class
80()
81extends Foo {};
82-----
83$stmts[0]->expr->args[] = new Node\Expr\Variable('a');
84$stmts[0]->expr->args[] = new Node\Expr\Variable('b');
85$stmts[1]->expr->args[] = new Node\Expr\Variable('a');
86$stmts[1]->expr->args[] = new Node\Expr\Variable('b');
87$stmts[2]->expr->args[] = new Node\Expr\Variable('a');
88$stmts[2]->expr->args[] = new Node\Expr\Variable('b');
89$stmts[3]->expr->args[] = new Node\Expr\Variable('a');
90$stmts[3]->expr->args[] = new Node\Expr\Variable('b');
91$stmts[4]->expr->args[] = new Node\Expr\Variable('a');
92$stmts[4]->expr->args[] = new Node\Expr\Variable('b');
93-----
94<?php
95foo
96($a, $b);
97
98$foo->
99bar($a, $b);
100
101Foo
102::bar ($a, $b);
103
104new
105Foo
106($a, $b);
107
108new class
109($a, $b)
110extends Foo {};
111