public function arrayFilter(array $array, array $callback = ['self', 'filter']): array
    {
        foreach ($array as $k => $v) {
            if (\is_array($v)) {
                $array[$k] = $this->arrayFilter($v, $callback);
            }
        }

        return array_filter($array, $callback);
    }
public function arrayFilter(array $array, array $callback = ['self', 'filter']): array
    {
        foreach ($array as $k => $v) {
            if (\is_array($v)) {
                $array[$k] = $this->arrayFilter($v, $callback);
            }
        }

        return array_filter($array, $callback);
    }
public function arrayFilter ( array $ array , array $ callback = [ 'self' , 'filter' ] ) : array { foreach ( $ array as $ k => $ v ) { if ( \ is_array ( $ v ) ) { $ array [ $ k ] = $ this -> arrayFilter ( $ v , $ callback ) ; } } return array_filter ( $ array , $ callback ) ; }
Enhanced version of array_filter which allow to filter recursively.

@param array          $array
@param callable|array $callback

@return array
Enhanced version of array_filter which allow to filter recursively .