Re: Re: Named arguments revisited
| From: | Ron Korving | Date: | Fri, 13 Jan 2006 11:25:12 +0000 |
| Subject: | Re: Re: Named arguments revisited | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-21507@lists.php.net to get a copy of this message | ||
That's a good point. But for PHP6, wouldn't everything have to be revised
anyway? Another option is to make named parameter support optional per
function. If a user calls a function with named parameters which the
function doesn't support, the engine can trigger an error. This way internal
functions and extensions can be upgraded with named parameter support as
time goes on.
- Ron
"Hartmut Holzgraefe" <hartmut@mysql.com> schreef in bericht
news:43C786E5.1020400@mysql.com...
> Ron Korving wrote:
>> Let me summarize it for you then.
>>
>> Advantages of named parameters over associative arrays:
>> - cleaner syntax
>> - support for type hints
>> - difference between required and optional parameters
>> - generating documentation (whether with something like phpDoc or an IDE)
>> - ...
>>
>> Can anyone summarize the disadvantages now please?
>
> - all internal and PECL functions need to be recoded as the API
> right now doesn't know any concept of parameter names at all
>
>
> --
> Hartmut Holzgraefe, Senior Support Engineer .
> MySQL AB, www.mysql.com