Inheritance is the mechanism of deriving a new class from an existing class. It allows child class to access  the data member and functions of parent class.

To implement Inheritance  you should use the keyword ‘extends’ in the class definition .

One of the most important concepts in object-oriented programming is that of inheritance. Inheritance allows us to define a class in terms of another class, which makes it easier to create and maintain an application. This also provides an opportunity to reuse the code functionality and fast implementation time.

When creating a class, instead of writing completely new data members and member functions, the programmer can designate that the new class should inherit the members of an existing class. This existing class is called the base class, and the new class is referred to as the derived class.

The idea of inheritance implements the is a relationship. For example, mammal IS-A animal, dog IS-A mammal hence dog IS-A animal as well and so on.



class a
public  function function_a(){
echo “class A”;

class b extends a
public function function_b(){
echo “class B”;

echo b::function_b();
echo b::function_a();


PHP Support the below given inheritance

Single level
hierarchical level

It does support multiple/Hybrid inheritance but multiple can be implemented through use of interface not directly