3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $one = [1]; $two = [42]; $arr_1 = ['k' => &$one]; $arr_2 = ['k' => &$two]; var_dump(current($arr1['k']), current($arr2['k'])); array_replace_recursive($arr1, $arr2); var_dump(current($arr1['k']), current($arr2['k']));
based on O6B3G
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: arr1 in /in/FYj3Y on line 8 Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 8 Notice: Undefined variable: arr2 in /in/FYj3Y on line 8 Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 8 NULL NULL Notice: Undefined variable: arr1 in /in/FYj3Y on line 9 Notice: Undefined variable: arr2 in /in/FYj3Y on line 9 Warning: array_replace_recursive(): Argument #1 is not an array in /in/FYj3Y on line 9 Notice: Undefined variable: arr1 in /in/FYj3Y on line 10 Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 10 Notice: Undefined variable: arr2 in /in/FYj3Y on line 10 Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 10 NULL NULL
Output for 5.4.11 - 5.6.28
Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 8 Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 8 NULL NULL Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 10 Warning: current() expects parameter 1 to be array, null given in /in/FYj3Y on line 10 NULL NULL
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/FYj3Y on line 3
Process exited with code 255.