3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait TR { function fa() { return 15; } } class A { function fa() { return 20; } } class B extends A { use TR; function fa() { return TR::fa() + 10; } } $o = new B; echo $o->fa();
based on J1QmO
Output for 7.0.0 - 7.2.0
Deprecated: Non-static method TR::fa() should not be called statically in /in/Hbk2e on line 19 25
Output for 5.6.8 - 5.6.28
Deprecated: Non-static method TR::fa() should not be called statically, assuming $this from incompatible context in /in/Hbk2e on line 19 25
Output for 5.4.11 - 5.5.35
Strict Standards: Non-static method TR::fa() should not be called statically, assuming $this from incompatible context in /in/Hbk2e on line 19 25
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/Hbk2e on line 3
Process exited with code 255.