企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
**抽象类的妙用**:从我那里继承的任何人都必须具有此功能(**父类调用子类的方法**) [抽象类的]**目的**。抽象类基本上说:从我那里继承的任何人都必须具有此功能(或这些功能) ``` abstract class whale { function __construct() { // some code here } function myfunc() { $this->test(); } abstract function test(); } class fish extends whale { function __construct() { parent::__construct(); } function test() { echo "So you managed to call me !!"; } } $fish = new fish(); $fish->test(); $fish->myfunc(); ```