3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait One { public function hello(): string { return '1'; } } trait Two { public function hello(): string { return '2'; } } class UsesBoth { use One, Two; }
Output for 8.2.31 - 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26
Fatal error: Trait method Two::hello has not been applied as UsesBoth::hello, because of collision with One::hello in /in/nBWcS on line 19
Process exited with code 255.
Output for 8.5.0 - 8.5.11
Fatal error: Trait method Two::hello has not been applied as UsesBoth::hello, because of collision with One::hello in /in/nBWcS on line 19 Stack trace: #0 {main}
Process exited with code 255.

preferences:
32.41 ms | 1155 KiB | 9 Q