3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Baz { public function foo(); } trait Foo { public function foo(){ echo 'foo me'; } } class Bar implements Baz { use Foo {Baz::foo as biz;} } $foo = new Foo(); $foo->biz();
based on uSFDe
Output for 7.0.0 - 7.2.0
Fatal error: Class Baz is not a trait, Only traits may be used in 'as' and 'insteadof' statements in /in/PAk6D on line 14
Process exited with code 255.
Output for 5.4.13 - 5.6.28
Fatal error: Class Baz is not a trait, Only traits may be used in 'as' and 'insteadof' statements in /in/PAk6D on line 17
Process exited with code 255.
Output for 5.4.11 - 5.4.12
Fatal error: Trait Baz is not used in /in/PAk6D on line 17
Process exited with code 255.
Output for 5.4.9 - 5.4.10
Fatal error: Cannot instantiate trait Foo in /in/PAk6D on line 20
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/PAk6D on line 8
Process exited with code 255.