1Arrow function
2-----
3<?php
4fn($a)
5=>
6$a;
7-----
8$stmts[0]->expr->expr = new Expr\Variable('b');
9-----
10<?php
11fn($a)
12=>
13$b;
14-----
15<?php
16fn(
17$a
18) => $a;
19-----
20$stmts[0]->expr->params[] = new Node\Param(new Expr\Variable('b'));
21-----
22<?php
23fn(
24$a, $b
25) => $a;
26-----
27<?php
28fn(
29$a
30)
31=>
32$a;
33-----
34// TODO: Format preserving currently not supported
35$stmts[0]->expr->params = [];
36-----
37<?php
38fn() => $a;
39-----
40<?php
41fn($a)
42: int
43=> $a;
44-----
45$stmts[0]->expr->returnType = new Node\Identifier('bool');
46-----
47<?php
48fn($a)
49: bool
50=> $a;
51-----
52<?php
53fn($a)
54: int
55=> $a;
56-----
57$stmts[0]->expr->returnType = null;
58-----
59<?php
60fn($a)
61=> $a;
62-----
63<?php
64fn($a)
65: int
66=> $a;
67
68static fn($a)
69: int
70=> $a;
71-----
72$stmts[0]->expr->static = true;
73$stmts[1]->expr->static = false;
74-----
75<?php
76static fn($a)
77: int
78=> $a;
79
80fn($a)
81: int
82=> $a;
83-----
84<?php
85fn($a)
86: int
87=> $a;
88
89fn&($a)
90: int
91=> $a;
92-----
93// TODO: Format preserving currently not supported
94$stmts[0]->expr->byRef = true;
95$stmts[1]->expr->byRef = false;
96-----
97<?php
98fn&($a): int => $a;
99
100fn($a): int => $a;
101