Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80479 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29674 invoked from network); 14 Jan 2015 19:15:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 19:15:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=dev@mabe.berlin; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=dev@mabe.berlin; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mabe.berlin from 80.237.132.167 cause and error) X-PHP-List-Original-Sender: dev@mabe.berlin X-Host-Fingerprint: 80.237.132.167 wp160.webpack.hosteurope.de Received: from [80.237.132.167] ([80.237.132.167:53293] helo=wp160.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/D7-19120-B40C6B45 for ; Wed, 14 Jan 2015 14:15:24 -0500 Received: from dslb-188-102-028-105.188.102.pools.vodafone-ip.de ([188.102.28.105] helo=[192.168.178.30]); authenticated by wp160.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) id 1YBTPU-0003oP-0m; Wed, 14 Jan 2015 20:15:20 +0100 Message-ID: <54B6C047.3070301@mabe.berlin> Date: Wed, 14 Jan 2015 20:15:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: internals@lists.php.net References: <52243BA6.5040905@sugarcrm.com> In-Reply-To: <52243BA6.5040905@sugarcrm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;dev@mabe.berlin;1421262924;e2e7db1a; Subject: Re: [PHP-DEV] [RFC] Skipping parameters take 2 From: dev@mabe.berlin (Marc Bennewitz) Hi Stas, I really like this RFC. It makes it simple to use defined defaults without the need to know about them of to updated. But I think adding "default" as new keyword is a big BC break! I personally also don't like it and asked myself why can't the parameter simply skipped? function foo ($a='a', $b='b') {} foo(); foo($a); foo(, $b); foo($a,); foo(,); Is it possible to use the default parameter on inheritance? class Bar { function foo($a='a', $b='b') {} } class Baz extends Bar { function foo($a=default, $b=default) { // do something parent::foo($a, $b); } } Marc Am 02.09.2013 um 09:17 schrieb Stas Malyshev: > 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 :)