ReflectionMethod::__toString

(PHP 5, PHP 7, PHP 8)

ReflectionMethod::__toStringReflectionMethod オブジェクトの文字列表現を返す

説明

publicReflectionMethod::__toString(): string

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 ] } }

参考

To Top