Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68862 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99086 invoked from network); 2 Sep 2013 20:20:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2013 20:20:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.123 smtp123.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.123] ([108.166.43.123:34544] helo=smtp123.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/FC-29856-FE2F4225 for ; Mon, 02 Sep 2013 16:19:59 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp8.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id F3EDD1A0B91; Mon, 2 Sep 2013 16:19:56 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp8.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id A3F151A0B90; Mon, 2 Sep 2013 16:19:56 -0400 (EDT) Message-ID: <5224F2EC.2090609@sugarcrm.com> Date: Mon, 02 Sep 2013 13:19:56 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Pierre Joye CC: PHP Internals References: <52243BA6.5040905@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Skipping parameters take 2 From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > However I still wonder what prevents to finally implement named > parameters too, it will provide the same feature while being even more For named params, you need to rewrite all args handling, since now it is a positional array and that doesn't work with named args. On the way you'd have to refactor zend_parse_parameters to understand named args (which aren't even named in many internals, so you'd have to add those) and deal with functions that use + and * in various creative ways and see how those can be reconciled with named params. And then of course is the question of by-ref parameters and how to make the syntax handle those too. Long story short, you'll have to rewrite everything that does with argument passing, argument receiving or even peeks into arguments. Skipping parameters is relatively simple - you just put NULL and fix tons of functions which don't use defaults properly (will need to be done on a larger scale with named params too, because named params means you can skip args). > handy and easier. I could dig the archives but I don't remember what > was the reason why we rejected the idea back then. Bikeshedding about the syntax mostly, but that all pales compared to amount of work that needs to be done in the engine to support named params. Unless, of course, I'm completely wrong and there's an easy way to do it, which I am totally missing - in which case please point it out. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227