PHP Abstract Class Usage example analysis, PHP abstract instance Analysis
The examples in this article describe the PHP abstract class usage. Share to everyone for your reference. Specific as follows:
<?php/* * Abstract class: * 1, at least one abstract method (no concrete implementation method) * 2, cannot be instantiated, can be inherited * 3, abstract class can have sub-abstract class * Relative to the interface: * 1, can have attributes * 2, a subclass can inherit only one abstract class , but multiple interfaces can be implemented * * * /abstract class Qian { abstract function getfirst (); function Gettwo () { echo "I am Gettwo";} } abstract class JJ extends Qian { abstract function getthree ();} C Lass Nan extends JJ { function GetFirst () { echo "I am GetFirst"; } function Getthree () { echo "I am Getthree"; }} $nn = new Nan (); $nn->getfirst (); $nn->gettwo (); $nn->g Etthree ();? >
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1028300.html www.bkjia.com true http://www.bkjia.com/PHPjc/1028300.html techarticle PHP Abstract Class Usage example analysis, PHP Abstract Example Analysis of this article describes the PHP abstract class usage. Share to everyone for your reference. The following: php/* * abstract class: * ...