What about allowing a "use" statement on these methods?

$someFoo = "bar";

$object = new class{
    function method() use ($someFoo) { return $someFoo;}
}

$object->method(); // "bar";

Reply via email to