3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_declared_user_traits() { $ret = array(); foreach (get_declared_traits() as $v) { // exclude system traits $rc = new ReflectionClass($v); $fileName = $rc->getFileName(); print $fileName."\n"; if ('systemlib.php' !== basename($fileName)) { $ret[] = $v; } } return $ret; } class this_is_a_class { } interface this_is_an_interface { public function this_is_an_interface_method(); } trait this_is_a_trait { } abstract class this_is_an_abstract_class { } final class this_is_a_final_class { } var_dump(get_declared_user_traits()); ?>
Output for git.master, git.master_jit, rfc.property-hooks
/in/O4BLK array(1) { [0]=> string(15) "this_is_a_trait" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.6 ms | 401 KiB | 8 Q