3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Evil { public function say($msg) { echo 'I am evil! ' . $msg; } } class Human { use Evil; public function say($msg) { echo 'I am not evil, even though I should say it after this anyway.'; Evil::say($msg); } } (new Human)->say('Hello World');
based on CT8sl
Output for 7.0.0 - 7.2.0
I am not evil, even though I should say it after this anyway. Deprecated: Non-static method Evil::say() should not be called statically in /in/KI7ec on line 13 I am evil! Hello World
Output for 5.6.8 - 5.6.21
I am not evil, even though I should say it after this anyway. Deprecated: Non-static method Evil::say() should not be called statically, assuming $this from incompatible context in /in/KI7ec on line 13 I am evil! Hello World
Output for 5.4.0 - 5.5.35
I am not evil, even though I should say it after this anyway. Strict Standards: Non-static method Evil::say() should not be called statically, assuming $this from incompatible context in /in/KI7ec on line 13 I am evil! Hello World
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/KI7ec on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/KI7ec on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/KI7ec on line 3
Process exited with code 255.