Answers for "added closure::call()"

0

added closure::call()

$f = function () {
    return $this->n;
};
class MyClass {
    private $n = 42;
}
$myC = new MyClass;
$c = $f->bindTo($myC, "MyClass");
$c();
Posted by: Guest on June-22-2021

Browse Popular Code Answers by Language