Array has `trailing comma`, why not the same for function parameter list?
| From: | Nam Gi VU | Date: | Sun, 30 Oct 2011 12:47:29 +0000 |
| Subject: | Array has `trailing comma`, why not the same for function parameter list? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315550@lists.php.net to get a copy of this message | ||
It is convenient to have a trailing comma when defining an array - so as
easy to add/remove code to add/remove an entry to the array
array(
'key00' => 'value00',
'key01' => 'value01',
'key02' => 'value02',
...
)
I suggest to PHP Development team to make it available in the syntax to
have a leading comma
array(
...
, 'key00' => 'value00'
, 'key01' => 'value01'
, 'key02' => 'value02'
)
in such way, we can thought of the leading commas as the list bulletings.
And the same things would be lovely to be applied also to function
parameter list. I don't see why not :)
What do you thing about my suggestion? Hope to hear from you!
--
Nam