Inheritance
Basic Concepts
put a class the attribute information in a is passed to another class B , and this is called:
B inherit A
A derives from B;
Basic Syntax:
several basic concepts
Inheritance: A class obtains its attributes from another existing class, called inheritance.
Derivation: Produces a new class from an existing class, called a derivation.
Parent class /Subclass: An existing class is a parent class, and a new class is a subclass. The parent class can also be called the "base class", the Ancestor class, the subclass is also called the derived class, the subordinate class,
Single inheritance: A class can inherit its attribute information only from a parent class. PHP and most object-oriented languages are single-inheritance modes . C + + is multiple inheritance.
Extensions: Define some of your own new and unique attribute information (properties, methods, and constants) in the subclass. Without an extension, inheritance is meaningless.
Inheritance in PHP