Closure::call
(No version information available, might only be in Git)
Closure::call — Calls the closure with the given parameters and returns the result, with $this bound to the given object $to
Beschreibung
Calls the closure with the given parameters and returns the result, with $this bound to the given object
to
Parameter-Liste
-
to -
-
parameters -
Rückgabewerte
Changelog
| Version | Beschreibung |
|---|---|
| 7.0.0 | Added Closure::call |
Beispiele
Beispiel #1 Closure::call() example
<?php
$foo = new StdClass;
$foo->bar = 3;
$foobar = function ($qux) { var_dump($this->bar + $qux); };
$foobar->call($foo, 4); // prints int(7)