3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); function byref_function(&$a, &$b) { $a = 2; $b = 1; } $array = array(1, 2); call_user_func_array('byref_function', $array); var_dump($array);
Output for 7.1.0
Warning: Parameter 1 to byref_function() expected to be a reference, value given in /in/sl0Pd on line 12 Warning: Parameter 2 to byref_function() expected to be a reference, value given in /in/sl0Pd on line 12 array(2) { [0]=> int(1) [1]=> int(2) }
Output for 5.3.0 - 7.0.14
Warning: Parameter 1 to byref_function() expected to be a reference, value given in /in/sl0Pd on line 12 array(2) { [0]=> int(1) [1]=> int(2) }
Output for 4.3.0 - 5.2.17
array(2) { [0]=> int(1) [1]=> int(2) }