3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait MyTrait { public static $foo = 'Zero'; } class MyClassOne { use MyTrait; } class MyClassTwo { use MyTrait; } MyClassOne::$foo = 'One'; MyTrait::$foo = 'Eklage'; MyClassTwo::$foo = 'Two'; // What will happen? Remember: trait is pseudo copy-paste, not real inheritance! echo MyClassOne::$foo; echo MyClassTwo::$foo; echo MyTrait::$foo;
based on foqum
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.1
OneTwoEklage