3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace TestApp\controllers { class Home { function index() { echo 'index'; } } } namespace main { use TestApp\controllers\Home; $className = 'Home'; $action = 'index'; $obj = new $className; call_user_func([$obj, $action]); }
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'Home' not found in /in/a35JA:17 Stack trace: #0 {main} thrown in /in/a35JA on line 17
Process exited with code 255.
Output for 5.4.12 - 5.6.28
Fatal error: Class 'Home' not found in /in/a35JA on line 17
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/a35JA on line 19
Process exited with code 255.