3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function baz(); } trait Bar implements Foo { } class BarBaz { use Bar; } var_dump(new BarBaz);
Output for 5.4.0 - 5.4.28
Fatal error: Cannot use 'Foo' as interface on 'Bar' since it is a Trait in /in/mAEE5 on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/mAEE5 on line 8
Process exited with code 255.

preferences:
183.39 ms | 1395 KiB | 65 Q