Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80630 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77864 invoked from network); 16 Jan 2015 10:04:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2015 10:04:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@tutteli.ch; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@tutteli.ch; sender-id=pass Received-SPF: pass (pb1.pair.com: domain tutteli.ch designates 80.74.154.78 as permitted sender) X-PHP-List-Original-Sender: php@tutteli.ch X-Host-Fingerprint: 80.74.154.78 ns73.kreativmedia.ch Linux 2.6 Received: from [80.74.154.78] ([80.74.154.78:48736] helo=hyperion.kreativmedia.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/87-39838-E12E8B45 for ; Fri, 16 Jan 2015 05:04:15 -0500 Received: (qmail 28961 invoked from network); 16 Jan 2015 11:04:10 +0100 Received: from 77.119.130.223.wireless.dyn.drei.com (HELO RoLaptop) (77.119.130.223) by ns73.kreativmedia.ch with ESMTPSA (AES256-SHA encrypted, authenticated); 16 Jan 2015 11:04:09 +0100 To: "'Stanislav Malyshev'" , "'Marc Bennewitz'" , References: <52243BA6.5040905@sugarcrm.com> <54B6C047.3070301@mabe.berlin> <54B6D0BA.8090104@gmail.com> In-Reply-To: <54B6D0BA.8090104@gmail.com> Date: Fri, 16 Jan 2015 11:04:04 +0100 Message-ID: <004701d03173$c4011630$4c034290$@tutteli.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGVucwNBrtZcrj7xRm/8nes4cZsHQGN8+mpAopyI/2dFptf8A== Content-Language: de-ch Subject: AW: [PHP-DEV] [RFC] Skipping parameters take 2 From: php@tutteli.ch ("Robert Stoll") Hi Stas, > -----Urspr=FCngliche Nachricht----- > Von: Stanislav Malyshev [mailto:smalyshev@gmail.com] > Gesendet: Mittwoch, 14. Januar 2015 21:26 > An: Marc Bennewitz; internals@lists.php.net > Betreff: Re: [PHP-DEV] [RFC] Skipping parameters take 2 >=20 > Hi! >=20 > > Is it possible to use the default parameter on inheritance? > > > > class Bar { > > function foo($a=3D'a', $b=3D'b') {} > > } > > > > class Baz extends Bar { > > function foo($a=3Ddefault, $b=3Ddefault) { > > // do something > > parent::foo($a, $b); > > } > > } >=20 > It's not part of the original proposal, and I'm not sure how easy it = would be to implement, but it sounds like a nice > extension, I didn't think about it. Since the RFC is already in vote, = I won't change it now, but I'll look into if it's possible to do > it, and if the RFC is accepted, and it proves possible, I'll propose = it separately. >=20 > -- > Stas Malyshev > smalyshev@gmail.com This would be quite a nice feature, even if this RFC does not pass. Just = as hint, there are ambiguous case which need to be considered: interface A{ function foo($a=3D1); } interface B{ function foo($a=3D"hi"); } class C implements A, B{ function foo($a=3Ddefault){} //what would be the default value? } Cheers, Robert