<?php trait A { abstract function foo(); } trait B { abstract function foo(): stdclass; } class C { use A; use B; function foo(): stdClass{ // valid for both A (mixed) and B (stdClass) return new stdClass; } } $x = new C(); var_dump($x->foo());
You have javascript disabled. You will not be able to edit any code.