Title: CaseInsensitiveDictionary::offsetSet
Published: March 29, 2023
Last modified: November 8, 2023

---

# CaseInsensitiveDictionary::offsetSet( $offset,  $value )

## Source

    ```php
     * Set the given item
     *
     * @param string $offset Item name
     * @param string $value Item value
     *
     * @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`)
     */
    #[ReturnTypeWillChange]
    public function offsetSet($offset, $value) {
    	if ($offset === null) {
    		throw new Exception('Object is a dictionary, not a list', 'invalidset');
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/requests/src/utility/caseinsensitivedictionary.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/Requests/src/Utility/CaseInsensitiveDictionary.php#L83)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/Requests/src/Utility/CaseInsensitiveDictionary.php#L83-L93)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwporg-requests-utility-caseinsensitivedictionary%2Foffsetset%2F)
before being able to contribute a note or feedback.