<?php abstract class Foo { abstract public function test(); } class Bar extends Foo { public function test(): Foo { return $this; } } var_dump((new Bar())->test());
You have javascript disabled. You will not be able to edit any code.