PDA

View Full Version : Inheritance In Php ?



Sonamkumari
07-03-2019, 10:33 AM
Hello Dear,

Please Tell Me What Is Inheritance In Php ?

lincy
07-24-2019, 06:33 AM
Inheritance is very useful if we want to create several similar classes. We can put the common properties and methods in one parent class and then inherit it in the child classes.

allen025
07-26-2019, 03:56 AM
With inheritance we can create child classes that are based on the parent class.
A child class inherits all the properties and methods of its parent, and it can also add additional properties and methods.
PHP supports single & multilevel inheritance:-
.It does not support multiple inheritance.
.In single inheritance, by using the extend keyword a class can inherit methods and members of another base class (only one).
.PHP uses the concept of inheritance only in the object model.
.If a class extends another then the parent class is to be declared before the child class.
.The classes must be defined before they are used.