Inheritance of classes in php
1. Subclasses inherit from parent classes using the extends keyword.
2. A subclass can only inherit from one parent class, but a parent class can inherit from another class
3. When inheriting, you can inherit the public/protected attributes and methods of the parent class, but you cannot inherit the private attributes and methods
4. In a subclass, you can declare attributes and methods with the same name as those of the parent class for overriding, but the inherited permissions can only be the same or become more and more relaxed, and cannot become more and more strict. For example, the parent class declares protected $a , then private $a cannot be declared in the subclass, only public or protected
http://www.bkjia.com/PHPjc/1071709.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1071709.htmlTechArticleInheritance of classes in php 1. Subclasses inherit from parent classes using the extends keyword 2. Subclasses can only inherit from A parent class, but the parent class can inherit from another class 3. When inheriting, you can inherit the public of the parent class...