class B{
public function __construct(){
$this->auto();
$this->c();
}
public function auto(){
spl_autoload_register(function($name){
echo $name;//输出A
});
}
public function c(){
new A();
}
}
new B();
//执行c方法时auto方法已经执行完了为什么还能实现自动加载
心有法竹
临摹微笑
随时随地看视频慕课网APP