namespace demo;class a{ public function index(){ return '我是index'; } public function demo(){ return '我是demo'; } }
use demo\a;class b{ static function Amode (){ return new a; } public Bindex(){ echo self::Amode()->index(); } public Bdata(){ echo self::Amode()->demo(); } }
use demo\a;class b{ public Bindex(){ $mode=new a(); echo $mode->index(); } public Bdata(){ $mode=new a(); echo $mode->demo(); } }
慕容708150
慕婉清6462132