ReflectionMethod执行类中的方法

来源:互联网 发布:软件对比分析 编辑:程序博客网 时间:2024/06/11 11:22
class HelloWorld {    public function sayHelloTo($name) {        return 'Hello ' . $name;    }}$reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo');echo $reflectionMethod->invoke(new HelloWorld(), 'Mike');

0 0