Answers for "added closure::call()[2]"

0

added closure::call()[2]

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

Browse Popular Code Answers by Language