Re: Proposal: Dangling comma in function call parameters
| From: | Christian Schneider | Date: | Thu, 23 Oct 2003 15:42:11 +0000 |
| Subject: | Re: Proposal: Dangling comma in function call parameters | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4944@lists.php.net to get a copy of this message | ||
Andi Gutmans wrote:
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).Ok, here the real-world example from our HTML generation toolkit: table( tr(td('row 1 cell 1'), td('row 1 cell 2')), tr(td('row 2 cell 1'), td('row 2 cell 2')), ); Being able to easily append lines here would be really nice :-) It doesn't break existing things _and_ it's up to the programmer to use this feature, same as in array(). I was also thinking of proposing named parameters, i.e. basically removing the need for array() in foo(array('style' => 'hot', 'size' => 42)); but I guess that'll be even more controversial :-) Ok, that's it from my side, it's up to you now, - Chris