3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FooNotUsingBarTrait { } if (trait_exists(BarTrait::class)) { class Foo extends FooUsingBarTrait { } } else { class Foo extends FooNotUsingBarTrait { } } $foo = new Foo(); var_dump( get_class($foo), class_parents(Foo::class) );
based on fCLkt
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.1
string(3) "Foo" array(1) { ["FooNotUsingBarTrait"]=> string(19) "FooNotUsingBarTrait" }