Abstract classes cannot override abstract methods of abstract parent classes when they inherit another abstract class。 This usage can be understood as an extension of the abstract class.
The following example shows that an abstract class inherits from another abstract class and does not need to override the abstract method.
<?abstract class User { protected $sal = 0; Abstract function getsal (); Abstract function Setsal ($sal); } Abstract class Vipuser extends User { }?>
Abstract classes cannot be overridden after they are inherited by an abstract method. If a rewrite occurs, the system will error.
<?abstract class User { protected $sal = 0; Abstract function getsal (); Abstract function Setsal ($sal);} Abstract class Vipuser extends User { abstract function setsal ();}? >
Program Run Result:
Fatal Error:can ' t inherit abstract function User::setsal () (previously declared abstract in Vipuser) in E:\PHPProjects\te st.php on line 14
Conclusion: Abstract classes inherit abstract classes to extend the abstract class.
<?abstract class User { protected $sal = 0; Abstract function getsal (); Abstract function Setsal ($sal);} Abstract class Vipuser extends User { protected $commision = 0; Static abstract function getcommision (); Abstract function setcommision (); }? >
The code above extends the method of the parent class