PHP 5.6.7 is available

ReflectionFunctionAbstract::isClosure

(PHP 5 >= 5.3.0)

ReflectionFunctionAbstract::isClosureChecks if closure

Descrição

public bool ReflectionFunctionAbstract::isClosure ( void )

Checks whether the reflected function is a Closure.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

Returns TRUE if the function is a Closure, otherwise FALSE.

Exemplos

Exemplo #1 ReflectionFunctionAbstract::isClosure() example

<?php
// Non-closure
$function1 'str_replace';
$reflection1 = new ReflectionFunction($function1);
var_dump($reflection1->isClosure());

// Closure
$function2 = function () {};
$reflection2 = new ReflectionFunction($function2);
var_dump($reflection2->isClosure());
?>

O exemplo acima irá imprimir:

bool(false)
bool(true)

Veja Também

add a note add a note

User Contributed Notes

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