Re: [RFC] Skipping parameters take 2

From: Date: Wed, 14 Jan 2015 20:25:30 +0000
Subject: Re: [RFC] Skipping parameters take 2
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi!

> 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);
>     }
> }

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.

-- 
Stas Malyshev
[email protected]


Thread (69 messages)

« previous php.internals (#80491) next »