Skip to content

Describe named arguments. #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 10, 2022
Merged
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
11 changes: 9 additions & 2 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,12 @@ function fooBarBaz($arg1, &$arg2, $arg3 = [])
}
```

### 4.5 Method and Function Arguments
### 4.5 Method and Function Parameters
Copy link
Contributor

Choose a reason for hiding this comment

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

Here describe arguments and parameters both. In PHP used caption Function arguments. May be in PER save caption "Method and Function Arguments" also?


In the argument list, there MUST NOT be a space before each comma, and there
MUST be one space after each comma.

Method and function arguments with default values MUST go at the end of the argument
Method and function parameters with default values MUST go at the end of the argument
list.

```php
Expand Down Expand Up @@ -714,6 +714,13 @@ $app->get('/hello/{name}', function ($name) use ($app) {
});
```

If using named arguments, there MUST NOT be a space between the argument name
and colon, and there MUST be a single space between the colon and the argument value.

```php
somefunction($a, b: $b, c: 'c');
```

Method chaining MAY be put on separate lines, where each subsequent line is indented once. When doing so, the first
method MUST be on the next line.

Expand Down