xref: /PHP-7.4/ext/standard/tests/array/bug70808.phpt (revision 6531719d)
1--TEST--
2Bug #70808 (array_merge_recursive corrupts memory of unset items)
3--FILE--
4<?php
5
6$arr1 = array("key" => array(0, 1));
7$arr2 = array("key" => array(2));
8
9unset($arr1["key"][1]);
10
11$result = array_merge_recursive($arr1, $arr2);
12print_r($result);
13?>
14--EXPECT--
15Array
16(
17    [key] => Array
18        (
19            [0] => 0
20            [2] => 2
21        )
22
23)
24