public static function sortArray(array $versions)
    {
        // Empty array does not needs sorting
        if (count($versions) === 0) {
            return array();
        }

        // Array of one item (pivot) from the middle
        $pivotArray = array_splice(
            $versions,
            (int) floor((count($versions) - 1) / 2),
            1
        );

        // Smaller/greater than pivot stack
        $smaller = array();
        $greater = array();

        // Fill stacks
        foreach($versions as $version) {
            if (Compare::greaterThan($version, $pivotArray[0])) {
                $greater[] = $version;
            } else {
                $smaller[] = $version;
            }
        }

        // Recurse and merge results
        return array_merge(
            self::sortArray($smaller),
            $pivotArray,
            self::sortArray($greater)
        );
    }