3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Testme { public static function foo(&$ref, &$ref2) { $ref = 1; $ref2 = 2; } } class Invoker { public static function invoke($func_name, &$args){ call_user_func_array(array('Testme', $func_name), $args); } } $test = 5; $test2 = 6; $args[] = &$test; $args[] = &$test2; Invoker::invoke('foo', $args); var_dump($test); var_dump($test2);

preferences:
51.29 ms | 402 KiB | 5 Q