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
10 changes: 10 additions & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,16 @@ die();
$result = foo() ?? exit();
```

The `clone` language construct MUST always be used with parenthesis, even when the optional `$withProperties` argument is
not provided. For example:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrfnl How about something along the lines of

Suggested change
not provided. For example:
not provided. As such, it follows the same rules as function calls. For example:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it needs to be spelled out as this paragraph is within the "function and method call" section anyway, but I just wanted to clarify to avoid ending up with discussions about this in the PHPCS repo later on.


```php
$b = clone($a);
$b = clone($a, [
'foo' => 'bar',
]);
```

### 4.8 Function Callable References

A function or method may be referenced in a way that creates a closure out of it, by providing `...` in place of arguments.
Expand Down