|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-06-20 13:30 UTC] german dot drulyk at gmail dot com
[2018-06-20 14:16 UTC] requinix@php.net
-Status: Open
+Status: Verified
[2018-06-20 14:16 UTC] requinix@php.net
[2018-06-20 14:21 UTC] requinix@php.net
[2018-06-20 14:21 UTC] cmb@php.net
[2018-06-20 14:30 UTC] requinix@php.net
[2018-06-20 15:36 UTC] german dot drulyk at gmail dot com
[2018-06-21 09:27 UTC] laruence@php.net
[2018-06-21 09:27 UTC] laruence@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Description: ------------ Keys are duplicated in the sub-array. Test script: --------------- <?php $array1 = array( 'k' => array( 2 => 100, 98 => 200, ) ); $array2 = array( 'k' => array( 64 => 300 ) ); $array3 = array_merge_recursive( $array1, $array2 ); echo '<pre>'; var_dump( $array3 ); echo 'count: '.count( $array3['k'] ); Expected result: ---------------- array(1) { ["k"]=> array(3) { [2]=> int(100) [98]=> int(200) [99]=> int(300) } } count: 3 Actual result: -------------- array(1) { ["k"]=> array(3) { [2]=> int(100) [98]=> int(200) [2]=> int(300) } } count: 3