Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68849 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60673 invoked from network); 2 Sep 2013 12:53:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2013 12:53:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-wg0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:39491] helo=mail-wg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/66-29856-54A84225 for ; Mon, 02 Sep 2013 08:53:25 -0400 Received: by mail-wg0-f54.google.com with SMTP id e12so2920093wgh.9 for ; Mon, 02 Sep 2013 05:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=WiggwyP/fs6ypuNl0O7M00kmpUAzhOBLs/a3MrBU+HM=; b=wTmZgptZsjeVKorW/WU7LPhFu4fTlLzYW5NqpnaPxg3s5DnWDDaN60rKbZy7BhLEx+ GLHO5q+o2IYzjCVRXJj/W1BH5fzN10BP12X5PQc65UAZ3SLR1jTwTawcP6nvXR7CfE1J Fo6IB2NPfpIESHJr7mnLNBW5lRxwB8foq3OdjADA10NIYbFBdn2ZHNWMQTnykq9CjXw9 HJ0jXlhUpyhVfOw2pXFkcXCqCWTZbrr9N7L/6PNoRk/gtkUYMFYsWbknD5cFMIoc8eiH qFfp/Pezg2FgR0xo4yFczY+ClEqc6t3aXRvkWBgs9P143wv5sax+Ywy/79w34hmlABr3 Ck5A== X-Received: by 10.194.175.66 with SMTP id by2mr1095249wjc.59.1378126402576; Mon, 02 Sep 2013 05:53:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.5.9 with HTTP; Mon, 2 Sep 2013 05:52:42 -0700 (PDT) In-Reply-To: References: <52243BA6.5040905@sugarcrm.com> Date: Mon, 2 Sep 2013 14:52:42 +0200 Message-ID: To: Pierre Joye Cc: Stas Malyshev , PHP Internals Content-Type: multipart/alternative; boundary=089e013d19f8ae68ac04e5660e6b Subject: Re: [PHP-DEV] [RFC] Skipping parameters take 2 From: krebs.seb@gmail.com (Sebastian Krebs) --089e013d19f8ae68ac04e5660e6b Content-Type: text/plain; charset=ISO-8859-1 2013/9/2 Pierre Joye > hi Stas, > > On Mon, Sep 2, 2013 at 9:17 AM, Stas Malyshev > wrote: > > Hi! > > > > I've finally took some time to revive the skipping parameter RFC and > > patch. For those who doesn't remember what it is please see: > > https://wiki.php.net/rfc/skipparams > > TLDR version: > > > > The idea is to allow skipping parameters in function with optional > > arguments so that this: > > function create_query($where, $order_by, $join_type='INNER', $execute > > = false, $report_errors = true) > > > > can be called like this: > > create_query("deleted=0", "name", default, default, > > /*report_errors*/ true); > > > > Instead of trying to remember what the defaults are. > > The patch is here: > > > > https://github.com/php/php-src/pull/426 > > > > Any comments or feedback on the RFCs and the code are welcome, > > especially pointing out the cases where it may not work (which means we > > need more phpt's there :) > > Using default instead of ,,, is indeed much more readable. > > However I still wonder what prevents to finally implement named > parameters too, it will provide the same feature while being even more > handy and easier. And it covers an additional use-case: Self-explaning parameters like in "foo(is_strict = false)" instead of "foo(null, null, false)". > I could dig the archives but I don't remember what > was the reason why we rejected the idea back then. > > Cheers, > -- > Pierre > > @pierrejoye | http://www.libgd.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch --089e013d19f8ae68ac04e5660e6b--