3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); function byref_function(&$a, &$b) { $a = 3; $b = 4; } $array = array(1, 2); call_user_func_array('byref_function', $array); var_dump($a, $b);
Output for hhvm-3.10.0 - 3.12.0, 7.1.0
Warning: Parameter 1 to byref_function() expected to be a reference, value given in /in/4jNQ8 on line 11 Warning: Parameter 2 to byref_function() expected to be a reference, value given in /in/4jNQ8 on line 11 Notice: Undefined variable: a in /in/4jNQ8 on line 13 Notice: Undefined variable: b in /in/4jNQ8 on line 13 NULL NULL
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.0.14
Warning: Parameter 1 to byref_function() expected to be a reference, value given in /in/4jNQ8 on line 11 Notice: Undefined variable: a in /in/4jNQ8 on line 13 Notice: Undefined variable: b in /in/4jNQ8 on line 13 NULL NULL
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: a in /in/4jNQ8 on line 13 Notice: Undefined variable: b in /in/4jNQ8 on line 13 NULL NULL
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: a in /in/4jNQ8 on line 13 Notice: Undefined variable: b in /in/4jNQ8 on line 13 NULL NULL