时间:2021-07-01 10:21:17 帮助过:5人阅读
target[] = new $targetClass();
}
function __call($name, $args) {
foreach ($this->target as $obj) {
$r = new ReflectionClass($obj);
if ($method = $r->getMethod($name)) {
if ($method->isPublic() && !$method->isAbstract()) {
return call_user_func_array(array(&$obj, $name), $args);
}
}
}
}
}
$stu = new ClassDelegator('Student');
$stu->doWork('1111', 'rerew');
?