public static function sortKeysRecursively(array &$array, int $sortFlags = null): bool
    {
        foreach ($array as &$value) {
            if (is_array($value)) {
                if (self::sortKeysRecursively($value, $sortFlags) === false) {
                    return false;
                }
            }
        }
        return ksort($array, $sortFlags);
    }
public static function sortKeysRecursively(array &$array, int $sortFlags = null): bool
    {
        foreach ($array as &$value) {
            if (is_array($value)) {
                if (self::sortKeysRecursively($value, $sortFlags) === false) {
                    return false;
                }
            }
        }
        return ksort($array, $sortFlags);
    }
public static function sortKeysRecursively ( array & $ array , int $ sortFlags = null ) : bool { foreach ( $ array as & $ value ) { if ( is_array ( $ value ) ) { if ( self :: sortKeysRecursively ( $ value , $ sortFlags ) === false ) { return false ; } } } return ksort ( $ array , $ sortFlags ) ; }
Sorts multidimensional arrays by recursively calling ksort on its elements.

@param array $array the array to sort
@param integer $sortFlags may be used to modify the sorting behavior using these values (see http://www.php.net/manual/en/function.sort.php)
@return boolean true on success, false on failure
@see asort()
Sorts multidimensional arrays by recursively calling ksort on its elements .