I've been thinking about this RCF for a while now:

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

It just doesn't seem necessary - the only time I've ever found something
like this to be necessary, is when a function takes closures or other very
long arguments, some of which are optional... but actually, writing this in
a VCS-friendly way is already possible:

$tree->traverse(
    $tree
    ,
    function($node) {
        // ...
    }
);

... version 2 ...

$tree->traverse(
    $tree
    ,
    function($node) {
        // ...
    }
    ,
    function($node) {
        // ...
    }
);

This actually comes out more legible, in my opinion.

What really irks me about this patch, is that the trailing comma implies
that another optional argument may exist - it really doesn't make the code
more intuitive to read. The example on the page (using fopen) really isn't
a realistic use-case - who would break a couple of simple arguments into
individual lines like that?

Just my two cents...

- Rasmus

Reply via email to