假设我有3个类和方法;
file1.php
class A
{
public function insert()
{
/* some code to do something with DB */
}
}
file2.php
需要file1.php
class B extends A
{
public function sample()
{
/* doing something random */
}
}
file3.php
需要file2.php
class C extends B
{
public function something()
{
$this->insert(); //In here I want to use it like $this->A->insert(); OR $A->insert();
}
}