3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait A { public function A() { echo 'A'; } } trait B { use A; public function B() { $this->B(); echo 'B'; } } class C { use A; use B; public function C() { $this->A(); $this->B(); } } $c = new C; $c->C();
Output for 7.0.0 - 7.2.0
Fatal error: Trait method A has not been applied, because there are collisions with other trait methods on C in /in/SjEo4 on line 18
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Trait method A has not been applied, because there are collisions with other trait methods on C in /in/SjEo4 on line 26
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/SjEo4 on line 3
Process exited with code 255.