array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'reflectionmethod.getclosure.php', 1 => 'ReflectionMethod::getClosure', 2 => 'Returns a dynamically created closure for the method', ), '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' => 'en', 'path' => 'reference/reflection/reflectionmethod/getclosure.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

ReflectionMethod::getClosure

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

ReflectionMethod::getClosureReturns a dynamically created closure for the method

Açıklama

public ReflectionMethod::getClosure(?object $object = null): Closure

Create a closure which will call the method.

Bağımsız Değişkenler

object

Forbidden for static methods, required for other methods.

Dönen Değerler

Returns the newly created Closure.

Hatalar/İstisnalar

Throws a ValueError if object is null but the method is non-static.

Throws a ReflectionException if object is not an instance of the class this method was declared in.

Sürüm Bilgisi

Sürüm: Açıklama
8.0.0 object is now nullable.

Ayrıca Bakınız