kphp
kphp copied to clipboard
allowed trailing comma for function parameter lists and closure use lists
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