3v4l.org

run code in 300+ PHP versions simultaneously
<?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());

preferences:
28.06 ms | 404 KiB | 5 Q