3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php trait TestTrait { public $test function () { return __FUNCTION__; }; } class A { use TestTrait; public function testTraitFunc() { echo $this->test; } } $a = new A(); $a->testTraitFunc();
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting ',' or ';' in /in/SbTVM on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING in /in/SbTVM on line 3
Process exited with code 255.