91亚洲精品福利在线播放,欧美日韩国产在线人成app,天天躁日日躁疯人影院,sao虎视频最新网站入口,精品久久久久久中文字幕女

Closure::call

(PHP 7, PHP 8)

Closure::call綁定并調用閉包

說(shuō)明

public Closure::call(object $newThis, mixed ...$args): mixed

暫時(shí)將閉包綁定到 newThis,并使用任意給定的參數調用它。

參數

newThis

在調用期間將閉包綁定到 object。

args

零個(gè)或多個(gè)參數,他們將作為參數傳遞給閉包。

返回值

返回閉包的返回值。

范例

示例 #1 Closure::call() 示例

<?php
class Value {
    protected 
$value;
    public function 
__construct($value) {
        
$this->value $value;
    }
    public function 
getValue() {
        return 
$this->value;
    }
}
$three = new Value(3);
$four = new Value(4);
$closure = function ($delta) { var_dump($this->getValue() + $delta); };
$closure->call($three4);
$closure->call($four4);
?>

以上例程會(huì )輸出:

int(7)
int(8)
91亚洲精品福利在线播放,欧美日韩国产在线人成app,天天躁日日躁疯人影院,sao虎视频最新网站入口,精品久久久久久中文字幕女