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) { $args = func_get_args(); $byref = array_slice($args,1); call_user_func_array(array('Testme', $func_name), &$byref); } } $test = 2; Invoker::invoke('foo', $test); var_dump($test);
Output for 5.4.18 - 5.4.19
Fatal error: Call-time pass-by-reference has been removed in /in/C6YdI on line 12
Process exited with code 255.
Output for 5.4.0 - 5.4.17
Fatal error: Call-time pass-by-reference has been removed in /in/3BWRs on line 12
Process exited with code 255.
Output for 5.3.28 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/C6YdI on line 12 Warning: Parameter 1 to Testme::foo() expected to be a reference, value given in /in/C6YdI on line 12 int(2)
Output for 5.3.0 - 5.3.27
Deprecated: Call-time pass-by-reference has been deprecated in /in/3BWRs on line 12 Warning: Parameter 1 to Testme::foo() expected to be a reference, value given in /in/3BWRs on line 12 int(2)

preferences:
172.1 ms | 1395 KiB | 57 Q