3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Testme { public static function foo(&$ref) { $ref = 1; } } class Invoker { public static function invoke($func_name) { $trace = debug_backtrace(); $args = &$trace[0]['args']; exit(print_r($args, true)); call_user_func_array(array('Testme', $func_name), array_slice($args,1)); } } $test = 2; Invoker::invoke('foo', $test); var_dump($test);

preferences:
40.04 ms | 402 KiB | 5 Q