首页 > 代码库 > 反射API

反射API

class HelloWorld{
public function sayHelloTo($name,$value){
return ‘Hello,‘.$name.$value;
}
}
$reflectionMethod=new ReflectionMethod(‘HelloWorld‘, ‘sayHelloTo‘);
echo $reflectionMethod->invokeArgs(new HelloWorld(), array(‘kcc‘,‘fuck‘,‘back‘));