Re: AW: [PHP-DEV] [RFC] Skipping parameters take 2
| From: | Stanislav Malyshev | Date: | Fri, 16 Jan 2015 20:34:45 +0000 |
| Subject: | Re: AW: [PHP-DEV] [RFC] Skipping parameters take 2 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80661@lists.php.net to get a copy of this message | ||
Hi!
> 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=1); } interface B{ function
> foo($a="hi"); } class C implements A, B{ function foo($a=default){}
> //what would be the default value? }
I'm not sure specifying the default on the interface makes much sense,
since you'd have to override it anyway. I am inclined to only support it
for extending (parent class). But if there's an easy way to do it for
interfaces, it's ok - but checking that there are no duplicates may be
expensive.
--
Stas Malyshev
smalyshev@gmail.com