3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $aPools = []; $aPools[1] = [ 'Redeployment' => 100, 'TalentPool' => 500, ]; $aPools[2] = []; function array_flatten($aArray) { $aOut = array(); foreach ($aArray as $mSubItem) { if(is_array($mSubItem)) { $aOut = array_merge($aOut, array_flatten($mSubItem)); } else { $aOut[] = $mSubItem; } } return $aOut; } print_r(array_flatten($aPools));
based on LffSJ
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
Array ( [0] => 100 [1] => 500 )