【发布时间】:2015-11-17 10:48:33
【问题描述】:
我想在没有声明 new child() 的情况下调用主类中的子方法;
class main {
function __construct() {
}
public function test() {
}
}
class child extends main {
function __construct() {
}
function childmethod() {
return "test";
}
}
$main = new main();
$main->childmethod();
祝你好运
【问题讨论】:
标签: php