Re: Re: Named arguments revisited
| From: | Brad Fisher | Date: | Fri, 13 Jan 2006 17:32:39 +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-21519@lists.php.net to get a copy of this message | ||
Hartmut Holzgraefe wrote:
Ron Korving wrote:function foo($a = null, $b = 1, $c = 2) {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 Forgive me if I'm wrong, but shouldn't all this be sorted out at the code parsing phase? For example:
...} foo(c: 25); The above call to foo would be interpreted _by the parser_ as if all parameters were provided: foo(null, 1, 25); Thus no need to rework internal parameter passing API at all. Perhaps I'm missing something? -Brad