Re: RfC: rethink OO inheritance strictness
| From: | Jochem Maas | Date: | Mon, 07 Aug 2006 11:43:21 +0000 |
| Subject: | Re: RfC: rethink OO inheritance strictness | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25229@lists.php.net to get a copy of this message | ||
Pierre wrote:
> Hello,
>
> On 8/7/06, Marcus Boerger <helly@php.net> wrote:
>
>> > class Foo {
>> > public interface function myFoo($x) { echo $x; } // strict
>> method signature enforced
>> > }
>>
>> > class Bar extends Foo {
>> > public function myFoo() { echo "bar"; } // this would be
>> E_FATAL
>> > }
>>
>> > class Qux extends Foo {
>> > public interface function myFoo($x) { echo $x; } // this is
>> okay.
>> > }
>>
>> Hmm i see some elegance here :-)
OT: that's a nice thing for a 'php mug' to hear coming from a 'php dev' :-)
>
> This is exactly what has been proposed last week, add a keyword to the
> declaration to mark a method as strict.
having reread the thread this does seem to be pretty much the case, although
my suggestion saves on adding a new keyword and by reusing the 'interface'
keyword hopefully sparks, in the mind of the developer, the direct correlation
between interfaces and strict methods.
> And I'm in favour of this solution.
I very much hope that this means there is a potential to resolve the 'mexican standoff'
between the 2 camps and dissapate some of the [perceived] animosity between 2 (or more)
great contributors to the php project (your both 'the good guy', something which is easy
to forget in the heat of an argument :-).
kind regards,
Jochem
>
> --Pierre