Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /tests/classes interface_class.phpt interface_doubled.phpt interface_implemented.phpt interface_instantiate.phpt interface_member.phpt interface_method.phpt interface_method_final.phpt interface_method_private.phpt interface_must_be_implemented.phpt
[email protected] ((Marcus Börger)) Wed, 12 Mar 2003 20:11:51 +0100
| Newsgroups | php.dev |
|---|---|
| Message-ID | <[email protected]> |
At 19:57 12.03.2003, Shane Caraveo wrote:
>A class extending an interface seems just weird to me. classes should
>only extend classes, and implement interfaces. interfaces can extend
>interfaces. I haven't been following the interfaces stuff (I'm going to
>have to backtrack and read it all, very happy if this stuff will do what I
>want), but I would hope we have some capability of implementing multiple
>interfaces in a class somehow.
>
>interface JAZ {}
>interface FOO {}
>interface BAR extends FOO {}
>class foo implements FOO {}
This works even though i do not like extends FOO.
>class foobar extends foo implements (BAR,JAZ) {}
This doesn't - i hope - trying -
<?php
interface a {}
interface b {}
class c implements (a,b) {}
/usr/src/php4-HEAD/-(4) : Parse error - parse error, unexpected '(',
expecting T_STRING or T_PAAMAYIM_NEKUDOTAYIM or T_NAMESPACE_NAME
You have to do
class foobar extends foo implements BAR,JAZ {}
marcus