# [VOTE] Allow a trailing comma in function calls

- Thread: https://staging.externals.io/message/100911
- Original archive: https://news-web.php.net/php.internals/100911
- Started by Sammy Kaye Powers on 2017-10-21T18:36:42+00:00
- Messages: 4
- RFC: Allow a trailing comma in function calls (Implemented (PHP 7.3)) — https://staging.externals.io/rfc/trailing-comma-function-calls.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://staging.externals.io/search.md?q={query} · RFCs at https://staging.externals.io/rfc.md · JSON API at https://staging.externals.io/api · documentation at https://staging.externals.io/llms.txt

---

## #100911 — Sammy Kaye Powers — 2017-10-21T18:36:42+00:00

URL: https://staging.externals.io/message/100911#100911

Hi internalsland!

Seeing that the mandatory two-week discussion period has completed and
there are no open questions, the RFC to allow a trailing comma in
function calls in PHP 7.3 is up for vote.

https://wiki.php.net/rfc/trailing-comma-function-calls

As this is a change to the language syntax, the RFC requires a 2/3
majority to pass. The voting period will last two weeks beginning now
(2017-10-21 18:30 UTC) and ending 2017-11-04 18:30 UTC.

Happy Halloween! :)

Thanks,
Sammy Kaye Powers
sammyk.me

---

## #100912 — me@jhdxr.com — 2017-10-22T05:24:05+00:00

URL: https://staging.externals.io/message/100911#100912 · In reply to: #100911

Hello Sammy,


I'd like to know if a trailing comma would affect the number of args or not. for example,
```
function foo(){
  return `func_num_args()`;

}
foo('a','b',);
```
would return 2 or 3?


best regards,
CHU Zhaowei

 
------------------ Original ------------------
From:  "Sammy Kaye Powers"<me@sammyk.me>;
Date:  Sun, Oct 22, 2017 02:36 AM
To:  "PHP Internals"<internals@lists.php.net>; 

Subject:  [PHP-DEV] [VOTE] Allow a trailing comma in function calls

 
Hi internalsland!

Seeing that the mandatory two-week discussion period has completed and
there are no open questions, the RFC to allow a trailing comma in
function calls in PHP 7.3 is up for vote.

https://wiki.php.net/rfc/trailing-comma-function-calls

As this is a change to the language syntax, the RFC requires a 2/3
majority to pass. The voting period will last two weeks beginning now
(2017-10-21 18:30 UTC) and ending 2017-11-04 18:30 UTC.

Happy Halloween! :)

Thanks,
Sammy Kaye Powers
sammyk.me

---

## #100913 — Kalle Sommer Nielsen — 2017-10-22T06:25:53+00:00

URL: https://staging.externals.io/message/100911#100913 · In reply to: #100912

Hi CHU Zhaowei

2017-10-22 7:24 GMT+02:00 CHU Zhaowei <me@jhdxr.com>:
> Hello Sammy,
>
>
> I'd like to know if a trailing comma would affect the number of args or not. for example,
> ```
> function foo(){
>   return `func_num_args()`;
>
> }
> foo('a','b',);
> ```
> would return 2 or 3?

With the current patch submitted for this RFC, your example will
return 2, as it will simply ignore the trailing comma at the end of
your call. You can see the more detailed test at github here[1].


[1] https://github.com/SammyK/php-src/compare/master...rfc-trailing-comma-function-calls#diff-88d4f8d1ae810e0722bf59cf1a739228

-- 
regards,

Kalle Sommer Nielsen
kalle@php.net

---

## #101053 — Sammy Kaye Powers — 2017-11-04T19:54:03+00:00

URL: https://staging.externals.io/message/100911#101053 · In reply to: #100911

Hello internals!

I'm pleased to announce that the two-week voting period for the RFC to
allow a trailing comma in function/method calls has officially closed
and the RFC has passed 30 to 10.

https://wiki.php.net/rfc/trailing-comma-function-calls

Thanks to everyone who participated in the process. Happy trailing
commas everybody, :)

Thanks,
Sammy Kaye Powers
sammyk.me
