3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Foo { public function bar() { echo "Hi!"; } } $ref = new ReflectionClass('Foo'); var_dump($ref->isAbstract(), $ref->newInstance());
based on s6iu9
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot instantiate trait Foo in /in/WvGtS:10 Stack trace: #0 /in/WvGtS(10): ReflectionClass->newInstance() #1 {main} thrown in /in/WvGtS on line 10
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Cannot instantiate trait Foo in /in/WvGtS on line 10
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/WvGtS on line 3
Process exited with code 255.