3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait T1 { public static $prop1 = 1; } trait T2 { public static $prop1 = 1; } class Base { use T1; } class Child extends base { use T2; }
Output for hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.1.25, 7.2.2 - 7.3.1
Output for 7.2.0 - 7.2.1
Fatal error: Base and T2 define the same property ($prop1) in the composition of Child. However, the definition differs and is considered incompatible. Class was composed in /in/oi4ns on line 18
Process exited with code 255.
Output for 5.4.0 - 5.6.32
Strict Standards: Base and T2 define the same property ($prop1) in the composition of Child. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in /in/oi4ns on line 21
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/oi4ns on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/oi4ns on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/oi4ns on line 3
Process exited with code 255.