Re: [RFC] Named parameters

From: Date: Fri, 06 Sep 2013 17:22:55 +0000
Subject: Re: [RFC] Named parameters
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Nikita,

Will it be possible to set the named parameter through using a parameter?
i.e. can you do:

function  multipleParamFunction($var1 = null, $var2 = null, $var3 = null,
$var4 = null) {
//...
}

$paramToOverride = 'var3';
testFunction($paramToOverride => 'bar');

which would override 'var3' in the function.

The syntax for setting a named parameter by a parameter clashes with some
of the suggested syntaxes. Even if it isn't going to be possible to support
this currently, it would be a good idea to not use a syntax that prevents
support of this in the future.

cheers
Dan


On Fri, Sep 6, 2013 at 5:39 PM, Nikita Popov <[email protected]> wrote:

> Hi internals!
>
> I created an RFC and preliminary implementation for named parameters:
>
>     https://wiki.php.net/rfc/named_params
>
> The RFC and implementation are not yet complete. I mainly want to have
> feedback on the idea in general and on the Open Questions (
> https://wiki.php.net/rfc/named_params#open_questions)
> in particular.
>
> Thanks,
> Nikita
>


Thread (46 messages)

« previous php.internals (#68912) next »