Re: Parents constructor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2006-03-24 at 01:48, Pham Huu Le Quoc Phuc wrote:
> In PHP, I can do the flowing code:

What you mean to say is that in PHP5 and only in PHP5 can you use
interfaces... and that would only be true if the following code were
correct.

>  interface A
> {
>   function Get();
> }
> 
> class B extends A
> {
>    function Get()
>   {
>         echo "class B";
> }
> }
> 
> class C extends A
> {
>    echo "class C";
> }

I'm very sure that the above class definition will generate a parse
error... and correct me if I'm wrong (I'm not by the way), but don't you
need to implement an interface versus extending it?

> $a = new B();
> $a->Get();
> $a = new C();
> $a->Get();
> 
> result:
> Class B
> Class C

At any rate, I fail to see the point of your response in relation to the
OP's question.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux