3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(@__TRAIT__ == '__TRAIT__'){ echo 'magic __TRAIT__ constant NOT defined'; //insert this code where needed, remember that because they are MAGIC constants defining __TRAIT__ is completely useless }else{ echo 'magic __TRAIT__ constant IS defined'; }
Output for 5.4.0 - 5.6.25, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
magic __TRAIT__ constant IS defined
Output for 4.3.0 - 5.3.29
magic __TRAIT__ constant NOT defined