The Closure class
(PHP 5 >= 5.3.0)
简介
Class used to represent anonymousfunctions.
Anonymous functions, implemented in PHP 5.3, yield objects of this type.This fact used to be considered an implementation detail, but it can nowbe relied upon. Starting with PHP 5.4, this class has methods that allowfurther control of the anonymous function after it has been created.
Besides the methods listed here, this class also has an __invoke method. This is for consistency with otherclasses that implement callingmagic, as this method is not used for calling the function.
类摘要
Closure {
/* 方法 */
__construct( void)
public static Closure bind( Closure $closure, object $newthis[, mixed $newscope = 'static'] )
public Closure bindTo( object $newthis[, mixed $newscope = 'static'] )
}
Table of Contents
◾Closure::__construct — Constructor that disallows instantiation
◾Closure::bind — Duplicates a closure with a specific bound object and class scope
◾Closure::bindTo — Duplicates the closure with a new bound object and class scope
发表评论 取消回复