<?phpclass Person{ public $name="xiaoming"; function say(){ echo "i am ".$this->name; } function run($addr){ echo "i am running at ".$addr; }}$per=new Person;//$per->say();//利用反射实现对象调用方法//$md=new ReflectionMethod(类名,方法名);//反射方法对象//反射的好处:可以获得方法的属性(是否公开,私有的,受保护的。)$md=new ReflectionMethod("Person","say");$md->invoke($per);//通过反射执行带参数的方法"$mds=new ReflectionMethod("Person","run");$mds->invokeArgs($per,array("China Hongkong"));