Add item to the array after specificed $idx

@param   string  $idx
@param   string  $key
@param   mixed   $value
@return  object
771851
public function insertAfter($idx, $key, $value=null)
	{
		if ($this->has($key))
		{
			$value = $value ?: $this->data[$key];

			unset($this->data[$key]);
		}

		$data = array();
		foreach ($this->data as $k => $v)
		{
			$data[$k] = $v;
			if ($idx == $k)
			{
				$data[$key] = $this->close($value);
			}
		}
		$this->data = $data;

		if (!$this->has($key))
		{
			$this->append($key, $value);
		}

		return $this;
	}
962877
public function add($key, $value)
    {
        if (empty($key)) return false;

        if (empty($this->engineVarList->$key)) {
            $this->engineVarList->$key = $value;

            return $this;
        }

        if (is_array($this->engineVarList->$key)) {
            array_merge($this->engineVarList->$key, $value);
        }

        return $this;
    }
1124229
public int set(long idx, int value) {
        checkIndex(idx);
        int i = SafeCast.safeLongToInt(idx + start);
        int old = elements[i];
        elements[i] = value;
        return old;
    }
837094
public function addItem($key, $value = null, $attribs = [])
    {
        if (is_array($value)) {
            $value = print_r($value, 1);
        }

        $this->addRow((array) $this->getValue($attribs, static::ROW))
            ->setRowCell(static::COL_KEY, $key, (array) $this->getValue($attribs, static::COL_KEY));

        if ($value !== false) {
            $this->setRowCell(static::COL_VALUE, $value, (array) $this->getValue($attribs, static::COL_VALUE));
        }

        return $this;
    }
352907
public function insert($substring, $idx, $encoding = null)
    {
        return $this->addModifier('insert', array($substring, $idx, $encoding));
    }
694330
public function add($key, $value){
        if( $this->exists($key) ){
            throw new Exception("Item already exists in storage ($key)  ($this->name)");
        }
        $this->storage[$key] = $value;
        return $this->storage[$key];

    }
1222596
public function add($key, $value)
    {
        if (!is_null($value)) {
            $this->data[$key] = $value;
        }

        return $this;
    }
1021094
public function prependSet($key, $value): ArrayCollection
    {
        $this->items = [$key => $value] + $this->items;

        return $this;
    }
942608
protected function add($i, $f, $value)
    {
        return Util::adiciona($this->atual, $i, $f, $value);
    }
267090
public Object set(String key, Object value) {
        int idx = keys.indexOf(key);
        if (idx == -1) {
            keys.add(key);
            values.add(value);
            return null;
        }
        return values.set(idx, value);
    }
79054
public function addValue($value, $index = null)
    {
        if ($this->value === null) {
            $this->value = [];
        }

        if ($index === null) {
            $this->value[] = $value;
        }
        else {
            $this->value[$index] = $value;
        }

        return $this;
    }
903172
public function setItem($id, $value = null)
    {    
        if (!is_array($value)) {
            $value = [$value];
        }
        
        parent::setItem(strtolower($id), ['id' => $id, 'value' => $value]);
    }
1207237
public function prepend($value, $key = null)
    {
        if (is_null($key)) {
            array_unshift($this->items, $value);
        }
        else {
            $this->items = [$key => $value] + $this->items;
        }

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

        if ($index !== false) {
            $this->values[$index] = $value;
        } else {
            $this->keys[] = $key;
            $this->values[] = $value;
        }
    }
726305
public function add($key, $value)
    {
        if (! isset($this->attributes[$key])) {
            $this->attributes[$key] = array();
        }

        $this->attributes[$key][] = $value;

        return $this;
    }
429846
public function set($key, $value = null)
    {
        if( is_array($key) ) {
            $this->values($key);
        } else {
            $this->value($key, $value);
        }
        return $this;
    }
389960
public function with( $key, $value = null ) {
		if ( is_array( $key ) ) {
			$this->context = array_merge( $this->getContext(), $key );
		} else {
			$this->context[ $key ] = $value;
		}
		return $this;
	}