Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47781 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34986 invoked from network); 4 Apr 2010 23:29:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Apr 2010 23:29:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=gregory@gregory.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=gregory@gregory.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain gregory.net from 216.40.44.87 cause and error) X-PHP-List-Original-Sender: gregory@gregory.net X-Host-Fingerprint: 216.40.44.87 smtprelay0087.hostedemail.com Received: from [216.40.44.87] ([216.40.44.87:35234] helo=smtprelay.hostedemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9A/31-41826-0D029BB4 for ; Sun, 04 Apr 2010 19:29:21 -0400 Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay02.hostedemail.com (Postfix) with SMTP id 40C3C2033686; Sun, 4 Apr 2010 23:29:18 +0000 (UTC) X-Panda: scanned! X-Spam-Summary: 2,0,0,16fed2b7d3cadafd,d41d8cd98f00b204,gregory@gregory.net,pierre.php@gmail.com:stas@zend.com:hannes.magnusson@gmail.com:internals@lists.php.net:rasmus@lerdorf.com,RULES_HIT:355:379:599:854:945:973:988:989:1187:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1766:1792:2198:2199:2379:2393:2559:2562:2693:2828:3027:3352:3653:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:4250:5007:6119:6261:8660:10004,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:none,DNSBL:none,Custom_rules:0:0:0 X-Session-Marker: 677265676F727940677265676F72792E6E6574 X-Filterd-Recvd-Size: 2070 Received: from imac.local (ool-45727d2d.dyn.optonline.net [69.114.125.45]) (Authenticated sender: gregory@gregory.net) by omf03.hostedemail.com (Postfix) with ESMTP; Sun, 4 Apr 2010 23:29:17 +0000 (UTC) Message-ID: <4BB920BC.50809@gregory.net> Date: Sun, 04 Apr 2010 19:29:00 -0400 User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Pierre Joye CC: Stanislav Malyshev , Hannes Magnusson , internals@lists.php.net, Rasmus Lerdorf References: <745C5243-EB51-4D43-B036-8A34CDBBB547@gregory.net> <4BB68D61.2070301@lerdorf.com> <4BB6938F.7090404@zend.com> <4BB90DB7.6060706@zend.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Named Parameters From: gregory@gregory.net (Gregory) A small comment: I don't think named parameters should seriously affect performance if we check for their presence during the call. That is to say, if a call has no named parameters, use what we use now. Otherwise, push an extra hash variable on to the end of the stack. Creating this hash variable should be no more overhead than if the user manually passed in an array() as the last parameter. Johannes: yeah I think I strongly prefer $parameter => 23. Like you said, it looks like a constant if we used f(parameter=>23) . In fact, arrays with arbitrary keys are useful and PHP already has $arr['foo-bar'], ${'foo-bar'} and $baz->{'foo-bar'}, so f('parameter' => 23) is not such a stretch. Especially since func_get_args returns an array. There is only one case where things get a little hairy, and that's f(2, '0' => 4) which will probably make func_get_args() return array(4) ... just as array(2, '0' => 4) would return array(4). Greg