Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,19 @@ $closureWithArgsVarsAndReturn = function ($arg1, $arg2) use ($var1, $var2): bool
};
```

If a closure contains no statements, then the body MUST be abbreviated as `{}` and placed on the same
line as the previous symbol, separated by a space:

```php
$noOpFunction = function () {};
```

If possible, empty-body closures SHOULD be replaced with arrow functions:

```php
$noOpFunction = fn() => null;
```

Argument lists and variable lists MAY be split across multiple lines, where
each subsequent line is indented once. When doing so, the first item in the
list MUST be on the next line, and there MUST be only one argument or variable
Expand Down