3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { public function hello(): string { return "Hello from Foo!"; } } class Bar { use Foo { hello as private somethingElse; } } $bar = new Bar(); var_dump($bar->hello()); // Throws var_dump($bar->somethingElse());

preferences:
84.11 ms | 404 KiB | 5 Q