<?php
$testArray= array(
'test1' => 'SingleValue1',
'test2' => 'SingleValue2'
);
function deepestArrays($array,$level=0,&$lowest=[]){
if(sizeof($subarrays=array_filter($array,function($v){return is_array($v);}))){ // isolate subarrays, iterate if any
foreach($subarrays as $subs){
deepestArrays($subs,$level+1,$lowest); // recurse each subarray
}
}else{
if(!sizeof($lowest) || ($lowest_level=key($lowest))==$level){ // if $levels is empty or current $level equals $lowest_level
$lowest[$level][]=$array; // append the array to the results
}elseif($lowest_level<$level){
$lowest=[$level=>[$array]]; // clear previous storage, store new lowest array
}
}
return current($lowest); // use current() to strip the temporary level identifying key
}
var_export(deepestArrays($testArray));