3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function fun() { echo "fooo"; } } $parts = ['Foo', 'fun']; $controller = array_shift($parts); $method = array_shift($parts); (new $controller)->$method();

preferences:
67.28 ms | 402 KiB | 5 Q