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
Index: Zend/zend_language_parser.y =================================================================== RCS file: /repository/Zend/Attic/zend_language_parser.y,v retrieving revision 1.23 diff -u -r1.23 zend_language_parser.y --- Zend/zend_language_parser.y 4 Aug 2002 06:39:44 -0000 1.23 +++ Zend/zend_language_parser.y 22 Oct 2003 21:28:45 -0000 @@ -336,7 +336,7 @@ function_call_parameter_list: - non_empty_function_call_parameter_list { $$ = $1; } + non_empty_function_call_parameter_list possible_comma { $$ = $1; } | /* empty */ { $$.u.constant.value.lval = 0; } ;
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php