8000 allowed trailing comma for function parameter lists and closure use lists by i582 · Pull Request #308 · VKCOM/kphp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

allowed trailing comma for function parameter lists and closure use lists #308

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

i582
Copy link
8000
Contributor
@i582 i582 commented Sep 11, 2021

RFC: https://wiki.php.net/rfc/trailing_comma_in_parameter_list
RFC: https://wiki.php.net/rfc/trailing_comma_in_closure_use_list

These two changes are very similar, therefore, they are combined into a single PR.

Function parameter list example:

function foo(
  $arg,
  $arg2, // allowed
) {
    echo $arg . $arg2 . "\n";
}

Closure use list example:

$foo = function () use (
    $a,
    $b, // allowed
) {
   echo $a, $b;
};

The GenTree::gen_list function is rather complicated, so a description has been added for it for all possible variants of its use.

#290

…ists

1. function foo(
     $arg,
     $arg2, // allowed
   ) { ... }

2. $foo = function () use (
       $a,
       $b, // allowed
   ) { ... };
@i582 i582 added the PHP8 PHP8 feature label Sep 11, 2021
@Tsygankov-Slava Tsygankov-Slava mentioned this pull request Jul 3, 2023
44 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP8 PHP8 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0