RE: [PHP] Extending classes multiple times

2001-12-06 Thread Matt Friedman

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:[EMAIL PROTECTED]] 
Sent: Thursday December 6, 2001 1:55 PM
To: Matt Friedman
Cc: [EMAIL PROTECTED]
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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
>  
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 


=
Please send all emails to my automatically redirecting
address: [EMAIL PROTECTED]

Regards,
Harshdeep S Jawanda
[[EMAIL PROTECTED]]

__
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Extending classes multiple times

2001-12-06 Thread Harshdeep S Jawanda

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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
>  
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 


=
Please send all emails to my automatically redirecting
address: [EMAIL PROTECTED]

Regards,
Harshdeep S Jawanda
[[EMAIL PROTECTED]]

__
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Extending classes multiple times

2001-12-06 Thread Rasmus Lerdorf

> 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?

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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]