<?php class Foo { public static function bar() : self { return new static(); } } class Foo2 extends Foo {} var_dump(Foo::bar()); var_dump(Foo2::bar());
You have javascript disabled. You will not be able to edit any code.