Re: RFC Skipping optional parameters for functions
| From: | Kris Craig | Date: | Mon, 28 May 2012 01:18:05 +0000 |
| Subject: | Re: RFC Skipping optional parameters for functions | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60682@lists.php.net to get a copy of this message | ||
On Sun, May 27, 2012 at 6:14 PM, William Betts <william.betts@gmail.com>wrote:
> On Sun, May 27, 2012 at 11:28 AM, Mathias Grimm <mathiasgrimm@gmail.com
> >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 two ways.
> >
> > <?php
> > goto a;
> > echo 'Foo';
> >
> > a:
> > echo 'Bar';
> > ?>
> >
> >
> > I also think that should exists a strict way to write code, something
> like
> > error_reporting, but to ensure a specific way to write code, gaining
> speed
> > in the whole compilation thing.
> >
> > strict_code_standard = K&R
> > strict_code_standard = GNU
> > strict_code_standard = PEAR
> > strict_code_standard = ZEND
> >
> > The GO land does it in some way
> >
>
> I can see how enforcing a strict coding standard would be useful, but only
> if you're also allowed to define your own.
>
I'm intrigued about the notion of having the option to use named parameters
in function calls/declarations. Aside from the obligatory, "Changing
anything in PHP would be too confusing!" complaint, what would be the
primary argument(s) against this?
--Kris