Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60131 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39627 invoked from network); 17 Apr 2012 23:25:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2012 23:25:18 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:44702] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/FA-21594-DDBFD8F4 for ; Tue, 17 Apr 2012 19:25:18 -0400 Received: by ghbg2 with SMTP id g2so3863634ghb.29 for ; Tue, 17 Apr 2012 16:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=r+AJnGArnb2awBEFqeJbOwC8DI5VFj5bgfaLoAhBIss=; b=cEOkfNSc56mw0OkADE/wiFswPHlMA4ElFv5giNkKY2W0HtJLlDRQb9E1lXdrPH3V2u g+cP3p/Ea41F4pkEeHL0JgUBoApX3ZoAxlwffC6AGID8ZEtygTkGhoGe53YKnZF8ObtQ OCGn7o3v9e/zziasgBQ+3/ydtSlXvlfNG216QQsAyvhNv1dXUbh7wT3WYQV13zHSfEdF V1fVE4iB/jzH3pjzT7scgaKKEH0wie6z9wAuQwn4Kd5a8s6csMGjsqVPqWjuI9zvi3c2 dkaSWv1hQIBIBu8Tinw5yBe2s/Z7/71BnMlvHXDfg6Lwgg+DOXgk6C1M4U2WmtsO/y4w 3UFg== Received: by 10.101.58.1 with SMTP id l1mr7903ank.67.1334705115365; Tue, 17 Apr 2012 16:25:15 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.146.86.14 with HTTP; Tue, 17 Apr 2012 16:24:35 -0700 (PDT) In-Reply-To: <4F8DF4B1.2040307@sugarcrm.com> References: <4F8DF4B1.2040307@sugarcrm.com> Date: Wed, 18 Apr 2012 08:24:35 +0900 X-Google-Sender-Auth: fV5WQNYPOQImFmPu2DfQ7MRQ-j8 Message-ID: To: Stas Malyshev Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi, 2012/4/18 Stas Malyshev : > Hi! > > One of the annoying things I've encountered in working with PHP was > dealing with functions having long optional parameter lists, especially > if you need to change only the last one - you have to copy all the > defaults. Full named params implementation would solve it, probably, but > before we have that here's an easier solution for part of the problem: > > 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. Introducing "undefined" might be good. Intention becomes clearer and we may do if ($var === undefined) { echo '$var is undefined'; } Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net