# Proposal: Dangling comma in function call parameters

- Thread: https://externals.io/message/4918
- Original archive: https://news-web.php.net/php.internals/4918
- Started by Christian Schneider on 2003-10-22T21:32:04+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #4918 — Christian Schneider — 2003-10-22T21:32:04+00:00

URL: https://externals.io/message/4918#4918

Hello everybody,
just joined the internals list (after being absent from php developers 
lists for a while) so excuse my ignorance if any topic I bring up has 
been discussed already. I checked the archives but couldn't find anything...

Proposal: Allow dangling commas in function call parameters.
Reasoning: We use some handy vararg tool functions and it's nice to be 
able to write
foo(
	1,
	2,
	3,
);
since it's then easy to add a new parameter without having to add a 
comma to the previous list.

This would be symmetrical to the array() syntax. The patch for zend 
(php4 from cvs) would be minimal and I can't see any 
backwards-compatibility issues right now (patch attached).

Any opinions?

Regards,
- Chris

---

## #4922 — Andi Gutmans — 2003-10-22T21:59:59+00:00

URL: https://externals.io/message/4918#4922 · In reply to: #4918

At 11:32 PM 10/22/2003 +0200, Christian Schneider wrote:
>Hello everybody,
>just joined the internals list (after being absent from php developers 
>lists for a while) so excuse my ignorance if any topic I bring up has been 
>discussed already. I checked the archives but couldn't find anything...
>
>Proposal: Allow dangling commas in function call parameters.
>Reasoning: We use some handy vararg tool functions and it's nice to be 
>able to write
>foo(
>         1,
>         2,
>         3,
>);
>since it's then easy to add a new parameter without having to add a comma 
>to the previous list.
>
>This would be symmetrical to the array() syntax. The patch for zend (php4 
>from cvs) would be minimal and I can't see any backwards-compatibility 
>issues right now (patch attached).
>
>Any opinions?

The only reason array() supports this is because there are some cases where 
people auto-generate initialization files which have a huge array() 
construct and it makes it slightly easier (don't have the last element 
problem).
In this case I don't see the same advantage and I see a disadvantage in 
readability and the possibility for PHP to give such an empty argument a 
meaning in future (although I doubt that'll happen).
So -1 from me.

Andi
