What about allowing a "use" statement on these methods? $someFoo = "bar";
$object = new class{
function method() use ($someFoo) { return $someFoo;}
}
$object->method(); // "bar";
What about allowing a "use" statement on these methods? $someFoo = "bar";
$object = new class{
function method() use ($someFoo) { return $someFoo;}
}
$object->method(); // "bar";