假设,为简单起见,这就是我的页面的设置方式:
class TFS extends PHP_db
{
    public function execute() {
        class Dostuff {
            public static function doit() {
                return "wee";
            }
        }
    Now here I can use Dostuff:doit() successfully
    And also $this->db->functionhere() which is from the PHP_db is also successful from here
    }
}
我需要弄清楚如何$this->db->functionhere()从doit()Dostuff 类中的函数内部调用..
我已经在 Dostuff 课程中尝试过这个:
protected $parent_object;
public function __construct( $object ) {
    $this->parent_object = $object;
 }
这来自 execute() 函数:$dostuffclass = new Dostuff($this);
但是当我尝试使用$parent_object->db->functionhere()它时它不起作用,告诉我它不是一个对象。