3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait T1 { public static function m(){ echo "t1 trait"; } } trait T2 { public static function m(){ echo "t2 trait"; } } class Test { use T1, T2; public function __construct() { var_dump((new ReflectionClass($this))->getTraitNames()); } } $t = new Test();
based on OXq6E
Output for 7.0.0 - 7.2.0
Fatal error: Trait method m has not been applied, because there are collisions with other trait methods on Test in /in/bVpbb on line 19
Process exited with code 255.
Output for 5.4.9 - 5.6.21
Fatal error: Trait method m has not been applied, because there are collisions with other trait methods on Test in /in/bVpbb on line 27
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/bVpbb on line 3
Process exited with code 255.