RE: [PHP] Extending classes multiple times
| From: | Matt Friedman | Date: | Thu, 06 Dec 2001 21:04:52 +0000 |
| Subject: | RE: [PHP] Extending classes multiple times | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-76935@lists.php.net to get a copy of this message | ||
This is what I had thought. I wasn't sure and needed the clarification.
Thanks as always!
Matt Friedman
-----Original Message-----
From: Harshdeep S Jawanda [mailto:hs_jawanda@yahoo.co.in]
Sent: Thursday December 6, 2001 1:55 PM
To: Matt Friedman
Cc: php-general@lists.php.net
Subject: Re: [PHP] Extending classes multiple times
I am not very sure what your question is, but "multiple inheritance"
means that a derived class can inherit (i.e., be derived from) more
than one class.
In multiple inhericance, you can have:
A B
| |
+---+---+
|
C
Here, C is simultaneously derived from A & B. You can't have this in
single inheritance (which is what the PHP manual is saying). This means
that C can be derived from either A or B, not both.
The following is always possible, irrespective of whether multiple
inheritance is supported or not:
A
|
+-B
|
+-C
|
+-D
This is three different classes (B, C and D) derived from A.
Hope this helps clarify your doubts.
--- Matt Friedman <matt@sprynewmedia.com> wrote:
> I had been under the impression that one could extend a class only
> once.
> That is, if I extend class A with class B I would then not be able to
> extend B again with any other class.
>
> See: http://www.php.net/manual/en/keyword.extends.php
> "An extended class is always dependent on a single base class, that
> is,
> multiple inheritance is not supported. Classes are extended using the
> keyword 'extends'."
>
> With some testing however, it appears that I can extend class B with
> class C and class C with class D and so on...
>
> Am I misinterpreting the manual? I suspect I am. Or is this a new
> feature. Thoughts?
>
> Thanks,
>
> Matt Friedman
> Web Applications Developer
> www.SpryNewMedia.com
> Email: matt@SpryNewMedia.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
>
>
=====
Please send all emails to my automatically redirecting
address: harshdeep@graffiti.net
Regards,
Harshdeep S Jawanda
[harshdeep@graffiti.net]
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net