3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Helper { protected function foo() { echo "foo"; } } trait MyTrait { use Helper; } abstract class Controller { use Helper; } class MyController extends Controller { use MyTrait; public function myFunction() { foo(); } } (new MyController)->myFunction();
based on YTXnT
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function foo() in /in/f9NSQ:24 Stack trace: #0 /in/f9NSQ(28): MyController->myFunction() #1 {main} thrown in /in/f9NSQ on line 24
Process exited with code 255.
Output for 5.4.12 - 5.6.21
Fatal error: Call to undefined function foo() in /in/f9NSQ on line 24
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/f9NSQ on line 3
Process exited with code 255.