Re: Revisiting the "Named Arguments" RFC

From: Date: Sun, 12 Jan 2014 20:10:06 +0000
Subject: Re: Revisiting the "Named Arguments" RFC
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Am 12.01.2014 20:31 schrieb "Rowan Collins" <[email protected]>:
>
> On 12/01/2014 08:16, Patrick Schaaf wrote:
>>
>> Regarding Syntax at the call site, I feel that it is exactly right the
way
>> it is proposed / implemented now. That way mirrors most closely the
syntax
>> of static array definition, while saving some typing (omitting of double
>> quotes) where key names do not clash with keywords. In fact, once
>> established, I would love static array initialization to also permit
>> nonclashing keys to omit the doublequotes :)
>
>
> Personally, I'm against allowing barewords to act as strings wherever
they don't - currently - clash with keywords, for two reasons:
>...
> Secondly, barewords already have a specific meaning in PHP: constants. By
convention, constants are UPPER_CASE, but the engine doesn't actually care,
and array(foo => bar) is actually valid PHP, but might be equivalent to
array('six by nine' => 42), if that's what 'foo' and 'bar' are
define()d as.

I completely overlooked that. You are totally right.

best regards
  Patrick


Thread (29 messages)

« previous php.internals (#71099) next »