企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
**一.继承规则不适用于Final Private方法** ``` class Foo { final private function testFoo(){} } class ChildFoo extends Foo{ private function testFoo(){ echo 123; } public function show(){ $this->testFoo(); } } $obj=new ChildFoo; $obj->show(); ```   **二.继承规则不适用于Static Private方法** ``` class Foo { static private function testFoo(){} } class User extends Foo{ public function testFoo(){ echo 123; } } $obj=new User; $obj->testFoo(); ```   **三.父类Private方法在子类中可出现同名抽象化方法** ``` class Foo { private function testFoo(){} } abstract class User extends Foo{ abstract function testFoo(); } class Person extends User{ public function testFoo(){ echo 123; } } $obj=new Person; $obj->testFoo(); ```