Re: [PHP-DEV] RFC Skipping optional parameters for functions

2012-05-28 Thread Stas Malyshev
On 5/27/12 10:27 AM, Mathias Grimm wrote: > in response to https://wiki.php.net/rfc/skipparams I want to suggest > something as depicted below: > > function very_long_params(name:$n, age:$a, other:$o) The goal of this proposal is not to introduce named parameters. If we ever do introduce named pa

Re: [PHP-DEV] RFC Skipping optional parameters for functions

2012-05-27 Thread Kris Craig
On Sun, May 27, 2012 at 6:14 PM, William Betts wrote: > On Sun, May 27, 2012 at 11:28 AM, Mathias Grimm >wrote: > > > Named parameter in the same way that goto does, with labels. A labeled > > parameter... > > But there always some drawbacks... such as mix named and conventional > > parameters. I

Re: [PHP-DEV] RFC Skipping optional parameters for functions

2012-05-27 Thread William Betts
On Sun, May 27, 2012 at 11:28 AM, Mathias Grimm wrote: > Named parameter in the same way that goto does, with labels. A labeled > parameter... > But there always some drawbacks... such as mix named and conventional > parameters. I think that you just chose one way and use, not allowing mix > these

Re: [PHP-DEV] RFC Skipping optional parameters for functions

2012-05-27 Thread Mathias Grimm
Named parameter in the same way that goto does, with labels. A labeled parameter... But there always some drawbacks... such as mix named and conventional parameters. I think that you just chose one way and use, not allowing mix these two ways. I also think that should exists a strict way to wri

Re: [PHP-DEV] RFC Skipping optional parameters for functions

2012-05-27 Thread Daniel Macedo
NOTE: Although related/solving some of the same problems; skipping optional parameters (several commas or using 'default' keyword) is different from using named parameters. And both have different supporters/haters over each change. I wouldn't like to restart the whole debate over the KISS, "Not t

[PHP-DEV] RFC Skipping optional parameters for functions

2012-05-27 Thread Mathias Grimm
in response to https://wiki.php.net/rfc/skipparams I want to suggest something as depicted below: function very_long_params(name:$n, age:$a, other:$o) { } or function very_long_params(:name = null, :age, :other) { $name = trim($name); ... } $result = very_long_params(age:20, other:'foo',