private function expandExplodeMod($op, $varname, array $varvalue)
    {
        $result = '';
        $first = true;
        $isList = $this->isNumericArray($varvalue);
        if (self::$behavior[$op]['named']) {
            foreach ($varvalue as $name => $value) {
                if ($first) {
                    $first = false;
                } else {
                    $result .= self::$behavior[$op]['sep'];
                }
                if ($isList) {
                    $result .= $varname;
                } else {
                    $result .= $name;
                }
                if (!$value) {
                    $result .= self::$behavior[$op]['ifemp'];
                } else {
                    $result .= '=' . rawurlencode($value);
                }
            }
        } else {
            if ($isList) {
                if (self::$behavior[$op]['allow'] === 'U') {
                    $varvalue = array_map('rawurlencode', $varvalue);
                } else {
                    $varvalue = array_map([$this, 'encodeNonReservedCharacters'], $varvalue);
                }
                $result .= implode(self::$behavior[$op]['sep'], $varvalue);
            } else {
                $newvals = [];
                foreach ($varvalue as $name => $value) {
                    if (self::$behavior[$op]['allow'] === 'U') {
                        $newvals[] .= rawurlencode($name) . '=' . rawurlencode($value);
                    } else {
                        $newvals[] .= $this->encodeNonReservedCharacters($name) . '=' . $this->encodeNonReservedCharacters($value);
                    }
                }
                $result .= implode(self::$behavior[$op]['sep'], $newvals);
            }
        }

        return $result;
    }