src/ArrayObject.php
private function _uxsortmRec(
        ArrayObject $a,
        array $sortFuncs,
        $depth = 0,
        $sortMode = ''
    ) {
        $goOn = (count($sortFuncs) > $depth + 1);
        $it   = $a->getIterator();

        while ($it->valid()) {
            if (null !== $sortFuncs[$depth]) {
                if ($sortMode == 'a') {
                    $it->current()->uasort($sortFuncs[$depth]);
                } else if ($sortMode == 'k') {
                    $it->current()->uksort($sortFuncs[$depth]);
                } else {
                    $it->current()->usort($sortFuncs[$depth]);
                }
            }

            if ($goOn) {
                $this->_uxsortmRec(
                    $it->current(),
                    $sortFuncs,
                    $depth + 1,
                    $sortMode
                );
            }

            $it->next();
        }
    }
private function _uxsortmRec(
        ArrayObject $a,
        array $sortFuncs,
        $depth = 0,
        $sortMode = ''
    ) {
        $goOn = (count($sortFuncs) > $depth + 1);
        $it   = $a->getIterator();

        while ($it->valid()) {
            if (null !== $sortFuncs[$depth]) {
                if ($sortMode == 'a') {
                    $it->current()->uasort($sortFuncs[$depth]);
                } else if ($sortMode == 'k') {
                    $it->current()->uksort($sortFuncs[$depth]);
                } else {
                    $it->current()->usort($sortFuncs[$depth]);
                }
            }

            if ($goOn) {
                $this->_uxsortmRec(
                    $it->current(),
                    $sortFuncs,
                    $depth + 1,
                    $sortMode
                );
            }

            $it->next();
        }
    }
Recursively applies all provided sorting functions to their corresponding
dimension of the array

@param ArrayObject $a         Represents the current dimension
in the active array branch
@param array                 $sortFuncs Holds the specified sorting
function for each dimension
@param int                   $depth     Current dimension
@param string                $sortMode  Possible values: 'a', 'k', ''
(= uasort, uksort, usort)