3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [ 1 => [ 1 => [ 'anna', 'alice' ], 2 => [ 'bob', 'bartold' ] ], 2 => [ 1 => [ 'carol' ], 2 => [ 'david' ] ] ]; $result = []; foreach ($array as $key => $arr) { foreach ($arr as $k => $v) { $result[$k] = $v; } } var_dump($result);
based on NQL45