(PHP 5 >= 5.1.2, PHP 7)
ReflectionMethod::getPrototype — 锟斤拷锟截凤拷锟斤拷原锟斤拷 (锟斤拷锟斤拷锟斤拷锟�)
锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷
锟斤拷锟斤拷原锟酵碉拷一锟斤拷 ReflectionMethod 实锟斤拷
锟斤拷锟斤拷锟斤拷锟矫伙拷锟皆拷停锟斤拷锟斤拷锟揭伙拷锟� ReflectionException
Example #1 ReflectionMethod::getPrototype() example
<?php
class Hello {
public function sayHelloTo($name) {
return 'Hello ' . $name;
}
}
class HelloWorld extends Hello {
public function sayHelloTo($name) {
return 'Hello world: ' . $name;
}
}
$reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo');
var_dump($reflectionMethod->getPrototype());
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
object(ReflectionMethod)#2 (2) { ["name"]=> string(10) "sayHelloTo" ["class"]=> string(5) "Hello" }