Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68837 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36924 invoked from network); 2 Sep 2013 09:20:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2013 09:20:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.179 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.179 mail-ob0-f179.google.com Received: from [209.85.214.179] ([209.85.214.179:35996] helo=mail-ob0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/71-29856-E5854225 for ; Mon, 02 Sep 2013 05:20:30 -0400 Received: by mail-ob0-f179.google.com with SMTP id fb19so4291057obc.10 for ; Mon, 02 Sep 2013 02:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4PHj57ynMK7nyTjXXaH/FOWVy9h+UGSqKdsnpKhOUjU=; b=qP5EfgvPMfbAXUpoxMxu+A1VAeGR+LbAYZ6D1MzZfGl27ZC6RR7vU2BfQ6Q02VZPPF oqiPxEHusIwT+YuT6CtfYnLViFYrfqSrLMRRl++Acl9mYf3fJUv4sH7WapR1G3NbYiwv eO8TziisXRKzgBI/g6XMrh4qb6lDmOm6tjp+/KzV3T3eXnQ2eFjxu3K1Ud5NkEJEZk8E Fd78pVsDvlC60fQNYZ0uqIy68sajua3mHYP/Q5iOzoALJ3FHdNLNcBMO4QXf68K8J1Yd 5L0fzASxIUT4MoknM8x2qFKhjHlANbCNYu+bS5K0DWM4zSRZTYELA7IzfG/JAza5lGgs NTGg== MIME-Version: 1.0 X-Received: by 10.182.87.170 with SMTP id az10mr16556598obb.10.1378113627743; Mon, 02 Sep 2013 02:20:27 -0700 (PDT) Received: by 10.182.98.8 with HTTP; Mon, 2 Sep 2013 02:20:27 -0700 (PDT) In-Reply-To: <52243BA6.5040905@sugarcrm.com> References: <52243BA6.5040905@sugarcrm.com> Date: Mon, 2 Sep 2013 11:20:27 +0200 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e0111bcfa3deb8804e563157f Subject: Re: [PHP-DEV] [RFC] Skipping parameters take 2 From: nikita.ppv@gmail.com (Nikita Popov) --089e0111bcfa3deb8804e563157f Content-Type: text/plain; charset=ISO-8859-1 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 :) > I'm -1 on this proposal. I think this doesn't really help readability. Right now you should implement functions with many options with an $options array. If we want to change something here, we should skip this step and go right for named arguments. I think I'll give implementing them a try. Nikita --089e0111bcfa3deb8804e563157f--