PHP-返射署理
PHP-返射代理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');
?
PHP之友评论