array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'reflectionmethod.getclosure.php', 1 => 'ReflectionMethod::getClosure', ), 'up' => array ( 0 => 'class.reflectionmethod.php', 1 => 'ReflectionMethod', ), 'prev' => array ( 0 => 'reflectionmethod.export.php', 1 => 'ReflectionMethod::export', ), 'next' => array ( 0 => 'reflectionmethod.getdeclaringclass.php', 1 => 'ReflectionMethod::getDeclaringClass', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/reflection/reflectionmethod/getclosure.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.4.0, PHP 7, PHP 8)
ReflectionMethod::getClosure — このメソッドに動的に作成されたクロージャを返す
object
staticメソッドの場合は不要、その他のメソッドの場合は必須となります。
新しく作成した Closure を返します。
object
が null
なのに、
メソッドが static ではない場合、
ValueError がスローされます。
object
が、
このメソッドが宣言されたクラスのインスタンスでない場合、
ReflectionException がスローされます。
バージョン | 説明 |
---|---|
8.0.0 |
object は、nullable になりました。
|