public static function combine(array $array, callable $callback, bool $overwrite = true): array
    {
        $combined = [];

        foreach ($array as $key => $value) {
            $combinator = $callback($value, $key);

            // fix for hhvm #1871 bug
            if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.10.0', '<=')) {
                $combinator->next();
            }

            $index = $combinator->key();

            if ($overwrite || ! isset($combined[$index])) {
                $combined[$index] = $combinator->current();
            }
        }

        return $combined;
    }