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