(PHP 5, PHP 7, PHP 8)
ReflectionMethod::__toString — ReflectionMethod オブジェクトの文字列表現を返す
この関数にはパラメータはありません。
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 ]
}
}