Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60194 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99917 invoked from network); 18 Apr 2012 18:30:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 18:30:13 -0000 Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain l-i-e.com designates 67.139.134.202 as permitted sender) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:2194] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/70-30923-E280F8F4 for ; Wed, 18 Apr 2012 14:30:07 -0400 Received: (qmail 65486 invoked by uid 98); 18 Apr 2012 18:30:06 -0000 Received: from localhost by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-2.05 ( Clear:RC:1(127.0.0.1):. Processed in 0.048728 secs); 18 Apr 2012 18:30:06 -0000 Received: from localhost (HELO www.l-i-e.com) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 18:30:05 -0000 Received: from webmail (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Wed, 18 Apr 2012 13:30:06 -0500 Message-ID: <93aa76977868446d6b5b57fa65cdaa95.squirrel@www.l-i-e.com> In-Reply-To: <4F8DFB65.4020506@seld.be> References: <4F8DF4B1.2040307@sugarcrm.com> <4F8DFB65.4020506@seld.be> Date: Wed, 18 Apr 2012 13:30:06 -0500 To: internals@lists.php.net User-Agent: SquirrelMail/1.4.21 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: ceo@l-i-e.com ("Richard Lynch") On Tue, April 17, 2012 6:23 pm, Jordi Boggiano wrote: > On 18.04.2012 00:54, Stas Malyshev wrote: >> 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); It might be worth mentioning in the docs edge cases like strtok. As you all know, I presume, the optional first param restarts parsing with a new string. When there is only one param, it continues parsing the previous first argument. As silly as this may seem to you experts, newbies will probably be confused by the optional argument syntax versus functions that change the parameter position... -- brain cancer update: http://richardlynch.blogspot.com/search/label/brain%20tumor Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE