Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60145 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63479 invoked from network); 18 Apr 2012 01:11:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 01:11:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=alan@akbkhome.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alan@akbkhome.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain akbkhome.com designates 202.81.246.113 as permitted sender) X-PHP-List-Original-Sender: alan@akbkhome.com X-Host-Fingerprint: 202.81.246.113 akbkhome.com Received: from [202.81.246.113] ([202.81.246.113:35894] helo=akbkhome.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/00-21594-2B41E8F4 for ; Tue, 17 Apr 2012 21:11:17 -0400 Received: from akdesk ([192.168.0.40]) by akbkhome.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Mailfort v1.2) (envelope-from ) id 1SKJQM-0004bV-EM for internals@lists.php.net; Wed, 18 Apr 2012 09:11:10 +0800 Message-ID: <4F8E14AC.90503@akbkhome.com> Date: Wed, 18 Apr 2012 09:11:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: internals@lists.php.net References: <4F8DF4B1.2040307@sugarcrm.com> In-Reply-To: <4F8DF4B1.2040307@sugarcrm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-mailfort-sig: 64b438873c23c1d5cfa5346216258700 Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: alan@akbkhome.com (Alan Knowles) On Wednesday, April 18, 2012 06:54 AM, Stas Malyshev wrote: > Hi! > > https://wiki.php.net/rfc/skipparams > > Basically, it allows you to do this: > > create_query("deleted=0", "name",,, /*report_errors*/ true); > > Implementation of it is here: > https://github.com/smalyshev/php-src/tree/skip_params > All things described in RFC seem to be working, please tell me if I > forgot anything. If it's accepted I'll also add tests, etc. of course. > Hate to be contrary, it does raise a few questions. a) it kind of encourages using long lists of arguments (which is not normally regarded as good practice) b) the usual recommendation for solving that issue is to accept an array (fake named arguments) c) the current situation would syntax error out on ,, as a function call argument, which is handy if you accidentally typed ,, twice by accident. if this changes, not only would you loose this syntax error, but it would do unpredictable things. For my 2c, does not look like a very good idea.. Regards Alan