3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = [ 'username' => [ '3805120' => 5, '3805121' => 7, ], 'login' => [ '3805120' => 9, '3805121' => 11, ], ]; $result = array_merge_recursive( array_combine(array_map(function($value) { return 'U'.$value; }, array_keys($data['username'])), $data['username']), array_combine(array_map(function($value) { return 'U'.$value; }, array_keys($data['login'])), $data['login']) ); $result = array_combine( array_map(function($value) { return substr($value, 1); }, array_keys($result)), $result ); var_dump($result);
based on TRTJM
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0beta1
array(2) { [3805120]=> array(2) { [0]=> int(5) [1]=> int(9) } [3805121]=> array(2) { [0]=> int(7) [1]=> int(11) } }