3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait A { function calc1($v) { echo '/ calc1 trait /'; } function calc($v) { echo '/ calc trait /'; } } class MyClass { use A; function calc($v) { echo '/ calc class /'; A::calc(5); //parent::calc($v); } } $x=new MyClass(); $x->calc(123);
based on qXfRS
Output for 7.0.0 - 7.2.0
/ calc class / Deprecated: Non-static method A::calc() should not be called statically in /in/QhrBA on line 16 / calc trait /
Output for 5.6.0 - 5.6.28
/ calc class / Deprecated: Non-static method A::calc() should not be called statically, assuming $this from incompatible context in /in/QhrBA on line 16 / calc trait /
Output for 5.4.0 - 5.5.38
/ calc class / Strict Standards: Non-static method A::calc() should not be called statically, assuming $this from incompatible context in /in/QhrBA on line 16 / calc trait /