2013/9/2 jbo...@openmv.com <jbo...@openmv.com>

> On Mon Sep 2 08:52 AM, Sebastian Krebs wrote:
> > 2013/9/2 Pierre Joye <pierre....@gmail.com>
> >
> > > >
> > > > Any comments or feedback on the RFCs and the code are welcome,
> > > > especially pointing out the cases where it may not work (which means
> > > > we need more phpt's there :)
> > >
> > > Using default instead of ,,, is indeed much more readable.
> > >
> > > However I still wonder what prevents to finally implement named
> > > parameters too, it will provide the same feature while being even more
> > > handy and easier.
> >
> >
> > And it covers an additional use-case: Self-explaning parameters like in
> > "foo(is_strict = false)" instead of "foo(null, null, false)".
> >
> >
>
> Lots of overlap between variadic functions, this proposal & named
> parameters.
>
>
I don't think that variadic functions prevent any of the other two, or that
they are used for the same cases.


> interface foo {
>   function formatUseCases(...$options);
> }
> - Advantage: No dependency on a class / object
> - Disadvantage: doesn't document what options are available, no default
> parameters
>


This is totally not a use case for variadic functions. The arguments of a
variadic function are indexed, not named. In addition, they have the same
type (or at least they are treated the same way).




Lazare INEPOLOGLOU
Ingénieur Logiciel

Reply via email to