update : 2015.11.03
php.shukuma.com

검색:
 
 
Checks if closure

ReflectionFunctionAbstract::isClosure

(PHP 5 >= 5.3.0)

ReflectionFunctionAbstract::isClosureChecks if closure

설명

public bool ReflectionFunctionAbstract::isClosure ( void )

Checks whether the reflected function is a Closure.

인수

이 함수는 인수가 없습니다.

반환값

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

예제

Example #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());
?>

위 예제의 출력:

bool(false)
bool(true)

참고