首页 > 代码库 > php 反射

php 反射

<?phpclass HelloWorld {    public function sayHelloTo($name) {        return ‘Hello ‘ . $name;    }}$reflectionMethod = new ReflectionMethod(‘HelloWorld‘, ‘sayHelloTo‘);echo $reflectionMethod->invoke(new HelloWorld(), ‘Mike‘);?> 

 

php 反射