时间:2021-07-01 10:21:17 帮助过:18人阅读
class Test1 {输出123呢?
static private $_instance; //静态私有
private public $_obj; //私有
static public function getInstance($_obj) {
self::$_instance = new self();
self::$_instance->_obj = $_obj;
self::$_instance->_obj->run();
}
}
class Test2 {
public function run() {
echo 123;
}
}
Test1::getInstance(new Test2()); //为什么没有