Skip to content

Commit 52a2d8e

Browse files
authored
Merge pull request #55 from KorvinSzanto/clarify_fn_keyword
Clarify `fn` keyword's usage as argument
2 parents 8d05d36 + e0d65c9 commit 52a2d8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ $foo->bar(
11881188
Short closures, also known as arrow functions, MUST follow the same guidelines
11891189
and principles as long closures above, with the following additions.
11901190

1191-
The `fn` keyword MUST be preceded by a space, and MUST NOT be succeeded by a space.
1191+
The `fn` keyword MUST NOT be succeeded by a space.
11921192

11931193
The `=>` symbol MUST be preceded and succeeded by a space.
11941194

@@ -1211,6 +1211,8 @@ $func = fn(
12111211
int $y,
12121212
): int
12131213
=> $x + $y;
1214+
1215+
$result = $collection->reduce(fn(int $x, int $y): int => $x + $y, 0);
12141216
```
12151217

12161218
## 8. Anonymous Classes

0 commit comments

Comments
 (0)