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: ma...@SpryNewMedia.com
This is not a new feature. In your example each class only has a single
parent. Multiple Inheritance is when you do something like:
class C extends A,B { ... }
Doing B extends A followed by C extends B is still single inheritance.
-Rasmus
Thanks as always!
Matt Friedman
-----Original Message-----
From: Harshdeep S Jawanda [mailto:hs_ja...@yahoo.co.in]
Sent: Thursday December 6, 2001 1:55 PM
To: Matt Friedman
Cc: php-g...@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 <ma...@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: ma...@SpryNewMedia.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general...@lists.php.net
> For additional commands, e-mail: php-gene...@lists.php.net
> To contact the list administrators, e-mail:
> php-lis...@lists.php.net
>
>
>
=====
Please send all emails to my automatically redirecting
address: hars...@graffiti.net
Regards,
Harshdeep S Jawanda
[hars...@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...@lists.php.net
For additional commands, e-mail: php-gene...@lists.php.net
To contact the list administrators, e-mail: php-lis...@lists.php.net
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 <ma...@sprynewmedia.com> wrote: