PHP 8.3.4 Released!

ReflectionFunction::__toString

(PHP 5, PHP 7, PHP 8)

ReflectionFunction::__toStringReflectionFunction を表現する文字列を返す

説明

public ReflectionFunction::__toString(): string

関数を表現した、人間が読める説明を取得します。 パラメータと戻り値が含まれます。

パラメータ

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

戻り値

文字列を返します。

例1 ReflectionFunction::__toString() の例

<?php
function 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 ]
  }
}

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top