On Mon, Mar 19, 2001 at 01:58:39PM -0500, Altunergil, Oktay wrote:

> As far as I know a class can extend multiple classes. What you can't do -in
> PHP- is two create a class that inherits from multiple parent classes
> (multiple inheritence). I believe this is available in C++ and Java and
> others. I also think the reason it is not available in PHP is because
> inheriting from multiple classes tend to cause ambiguity when both of the
> parent classess have a function with the same definition etc.
> 
> (I'm not an expert in this.. I'm just passing along what I have read).

Right.  You can extend a chain of classes, but you can't have a
singular class extend from multiple classes directly.

That is, this works:

Apple extends Fruit
Fruit extends Food

This doesn't:

Apple extends Fruit and Produce

Matt

> -----Original Message-----
> From: John Guynn [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 1:47 PM
> To: Php (E-mail)
> Subject: [PHP] OOP question regarding class extension
> 
> 
> Can one class extend multiple classes?  I'm still playing with OOP
> functionality and maybe my logic is reversed but I think I need one class to
> extend many others.
> 
> John Guynn
> 
> This email brought to you by RFCs 821 and 1225.
> 
> 
> -- 
> 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]

Reply via email to