Term
Inheritance
Meaning
Inheritance is a way for a class to build on another class by receiving its properties and methods and then adding or changing behaviour. The PHP manual says a subclass inherits the public and protected members of its parent, while private methods of the parent are not accessible to the child. A general Vehicle class could be extended by Car and Bike classes, for example. PHP allows one parent per class, so overuse can become tangled, and many developers prefer composition when the relationship is not a true is-a case. See also: Class, Trait, Interface, and the guide PHP Functions and Object Oriented Programming Concepts.