On Wed, Feb 20, 2013 at 12:47 AM, Florin Razvan Patan <florinpa...@gmail.com> wrote: > For example, I would expect that if I have: > > function A($b, $c = 'd') {} > > when I see A($b, ) to have no syntax errors but rather $c defaulted to > the value in the function signature, which is not implied nor assumed > by the RFC but it would be by the one reading a function. > Your assumption would be correct. Since the trailing comma is ignored, the function call happens with only one argument and the second is left as the default.
> Then when I have > > function A($b, $c = 'd', $e) {} > > to be able to have A($b, , $e) which again this RFC doesn't specify > that it allows but leads to confusion. > That function signature is invalid, so you'd never have code like that running anyway. The call is also invalid and again you wouldn't have code like that because it would never run. Thee RFC doesn't explicitly specify either of these points, but they are implied by the patch provided which only allows for a tailing comma at the end, not "bonus commas" in the middle or at the beginning. > As for the argument about the VCS, I really don't see an issue with > the current way of thing. Some people don't use the comma at the > end of the arrays and it doesn't mean that they all should. > Of course not, but as you stated it would help consistency if they could. -Sara -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php