1--TEST-- 2array_merge/replace_recursive() should unwrap references with rc=1 3--FILE-- 4<?php 5 6$x = 24; 7$arr1 = [[42]]; 8$arr2 = [[&$x]]; 9unset($x); 10$arr3 = array_replace_recursive($arr1, $arr2); 11$arr2[0][0] = 12; 12var_dump($arr3); 13 14unset($arr1, $arr2, $arr3); 15 16$x = 24; 17$arr1 = [42]; 18$arr2 = [&$x]; 19unset($x); 20$arr3 = array_merge_recursive($arr1, $arr2); 21$arr2[0] = 12; 22var_dump($arr3); 23 24?> 25--EXPECT-- 26array(1) { 27 [0]=> 28 array(1) { 29 [0]=> 30 int(24) 31 } 32} 33array(2) { 34 [0]=> 35 int(42) 36 [1]=> 37 int(24) 38} 39