Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21519 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77729 invoked by uid 1010); 13 Jan 2006 17:32:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 77714 invoked from network); 13 Jan 2006 17:32:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jan 2006 17:32:39 -0000 X-Host-Fingerprint: 65.122.208.20 mail.info-link.net Linux 2.4/2.6 Received: from ([65.122.208.20:56757] helo=mail.info-link.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 9F/3B-06425-734E7C34 for ; Fri, 13 Jan 2006 12:32:39 -0500 Received: from [192.168.1.60] (spooler.info-link.net [65.122.208.6]) by mail.info-link.net (8.12.11/8.12.11) with ESMTP id k0DHWYuQ010510 for ; Fri, 13 Jan 2006 11:32:34 -0600 Message-ID: <43C7E437.70209@info-link.net> Date: Fri, 13 Jan 2006 11:32:39 -0600 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net References: <43C67431.9090003@prohost.org><3A366ACB-20D4-42C7-BBAE-46F643E3A91F@intuitivefuture.com><878581203.20060112153625@ionzoft.com> <7.0.0.16.2.20060112154219.029d06c8@zend.com><43C75FEE.7040908@php.net> <6C.F4.25674.EFD67C34@pb1.pair.com> <43C786E5.1020400@mysql.com> In-Reply-To: <43C786E5.1020400@mysql.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ConnInfo-Version: Connection info milter (v0.5) running on milter.info-link.net if_addr=65.122.208.20 if_name=mail.info-link.net offical_name=mail.info-link.net pid=10510 X-ConnInfo: relay_addr=65.122.208.6 relay_name=spooler.info-link.net relay_helo=[192.168.1.60] milter_time=200601131132 queue_id=k0DHWYuQ010510 message_id=<43C7E437.70209@info-link.net> X-Antivirus: Scanned by Vexira Antivirus 1.0.2 VDB 8.1031 Subject: Re: [PHP-DEV] Re: Named arguments revisited From: brad@info-link.net (Brad Fisher) Hartmut Holzgraefe wrote: > 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 > > Forgive me if I'm wrong, but shouldn't all this be sorted out at the code parsing phase? For example: function foo($a = null, $b = 1, $c = 2) { ... } 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