ReflectionMethod::__toString
(PHP 5, PHP 7)
ReflectionMethod :: __ toString - 返回Reflection方法对象的字符串表示形式。
描述
public string ReflectionMethod::__toString ( void )
返回Reflection方法对象的字符串表示形式。
参数
该功能没有参数。
返回值
此ReflectionMethod实例的字符串表示形式。
例子
示例#1 ReflectionMethod :: __ toString()示例
<?php
class?HelloWorld?{
????public?function?sayHelloTo($name)?{
????????return?'Hello?'?.?$name;
????}
}
$reflectionMethod?=?new?ReflectionMethod(new?HelloWorld(),?'sayHelloTo');
echo?$reflectionMethod;
?>
上面的例子将输出:
Method [ <user> public method sayHelloTo ] {
@@ /var/www/examples/reflection.php 16 - 18
- Parameters [1] {
Parameter #0 [ <required> $name ]
}
}
← ReflectionMethod::setAccessible
ReflectionObject →
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com