Php/docs/reflectionfunction.tostring

提供:Dev Guides
< Php
移動先:案内検索

ReflectionFunction::__toString

(PHP 5, PHP 7)

ReflectionFunction::__toString文字列に変換する


説明

public ReflectionFunction::__toString ( ) : string

文字列に変換します。


パラメータ

この関数にはパラメータはありません。


返り値

その関数について、 ReflectionFunction::export() のような出力を返します。


例1 ReflectionFunction::__toString() の例

<?phpfunction title($title, $name){    return sprintf("%s. %s\r\n", $title, $name);}echo new ReflectionFunction('title');?>

上の例の出力は、 たとえば以下のようになります。


Function [ <user> function title ] {
  @@ Command line code 1 - 1

  - Parameters [2] {
    Parameter #0 [ <required> $title ]
    Parameter #1 [ <required> $name ]
  }
}

参考