tags:

views:

65

answers:

3

Thanks for your replies. Appreciate it alot!

+3  A: 

PHP supports single inheritance, where a child class (or subclass) may directly inherit from at most one parent class (or superclass). That parent class may in turn inhert from it's own parent, to an arbitrary number of levels (there may be some technical limit, but you will never hit it in practice).

This is in contrast with multiple inheritance languages which allow a given class to inherit from several parents.

meagar
+2  A: 

how many parents may a single class have

One

what is this process called?

Inheritance

Srinivas Reddy Thatiparthy
+1  A: 

Hmmm...

how many parents may a single class have

From another point of view, if you have :

class Animal {
    public function doA() {}
} 
class Human extends Animal {
    public function doB() {}
}
class Jedi extends Human {
    public function doC() {}
}

A Jedi is a Human, but he is also an Animal. This is polymorphism.

As you can see, a class may have any number of parents.


The answer to your question is clearly one, but it should have been written :

how many classes may a single class extend

mexique1