PHP has long supported trailing commas in array declarations like so:
<?php $a = array( 'Orange', 'Apple', 'Banana', );
This is useful for VCS (cvs, svn, git, hg, etc...) since individual lines in the list may be modified, added, or removed without having to touch unrelated lines which happen to be at the end of the list.
Function call arguments do not share this trait.
<?php // This is an error $fp = fopen( "sample.txt", "r+", );
Which means that adding additional parameters to the call forces touching both the new line and the prior one, which is bad for VCS history.
Similarly, function declarations have the same inconsistency with array() and list().
<?php // Invalid currently function foo( $bar, ) { /* ... */ }
This RFC proposes to allow trailing commas in function and method call argument lists and function argument declarations.
https://github.com/sgolemon/php-src/compare/master...trailing-comma
HipHop version: https://github.com/facebook/hiphop-php/commit/c1b7da6a4c128af5ddfc75f515c205de9f417a1e
Bonus comma in the middle of a void argument list
<?php phpinfo( , );
Trailing comma in yield() expression
<?php function mygen() { yield( 123, ); }
Note: Consideration for 5.6 inclusion, not 5.5.