If you need access to the methods in AProxifier then why does the anonymous > class extend A, you should extend AProxifier as you would with any other > class. >
Because A has the behavior I want to extend? An other example: class A {...} class B {...} class Factory { protected function protectedMethod() {...} function getA() { return new class extends A {.. call Factory::protectedMethod()? ..}; } function getB() { return new class extends B {.. call Factory::protectedMethod()? ..}; } } This is possible and welcomed with closures. I see it as useful for anonymous classes than it is for anonymous functions. What do others you think about it?