public function setValue($name, $value, $section = 0, $key = null)
    {
        if (!preg_match('/^[^\\[\\]]*$/', $name)) {
            throw new IniInvalidArgumentException("Invalid value name $name");
        }

        if (is_array($value)) {
            if ($key !== null) {
                throw new IniInvalidArgumentException('You cannot indicate a key for an array value');
            }
            $this->_setArrayValue($name, $value, $section);
        } else {
            $this->_setValue($name, $value, $section, $key);
        }
    }