The inheritance provides a relation between classes, parents and children. The inheritance is a common phenomena in an object model programming. The inheritance affects many classes that somehow relate to or with each other.

An extended class inherits all the public and private methods of the parent class. This helps to implement the same functionality without the need to rewrite methods in shared functionality classes. PHP manual provides a very good example for this context:

Examples of object and classes inheritance

 

›› go to examples ››