3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php trait MauricioTrait { public function sumStuff($a, $b) { return $a + $b; } public function multiplyStuff($a, $b) { return $a * $b; } } class MauricioClass { use MauricioTrait; public function printStuff() { return "Hello world!"; } } var_dump(method_exists(MauricioClass, 'sumStuff')); var_dump(in_array('MauricioTrait', class_uses(MauricioClass));
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected ';' in /in/FDBoB on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/FDBoB on line 2
Process exited with code 255.