<?php
$a = function($b) use (&$a) {
if (is_array($b)) {
$r = array_map($a, $b);
}
else {
$r = $b + 100;
}
return $r;
};
$b = range(1, 10);
$b[] = range(11, 13);
echo '<pre>';
dump(array_map($a, $b));
echo '</pre>';
^ array:11 [ 0 => 101 1 => 102 2 => 103 3 => 104 4 => 105 5 => 106 6 => 107 7 => 108 8 => 109 9 => 110 10 => array:3 [ 0 => 111 1 => 112 2 => 113 ] ]