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