function set($key, $value)
    {
        $index = array_search($key, $this->keys);

        if ($index !== false) {
            $this->values[$index] = $value;
        } else {
            $this->keys[] = $key;
            $this->values[] = $value;
        }
    }
function set($key, $value)
    {
        $index = array_search($key, $this->keys);

        if ($index !== false) {
            $this->values[$index] = $value;
        } else {
            $this->keys[] = $key;
            $this->values[] = $value;
        }
    }
function set ( $ key , $ value ) { $ index = array_search ( $ key , $ this -> keys ) ; if ( $ index !== false ) { $ this -> values [ $ index ] = $ value ; } else { $ this -> keys [ ] = $ key ; $ this -> values [ ] = $ value ; } }
Sets a key-value pair in the mapping.  If the key already
exists, its value is replaced with the new value.

@param string $key
@param mixed $value
Sets a key - value pair in the mapping . If the key already exists its value is replaced with the new value .