public function offsetSet($index, $newval)
    {
        if ($newval instanceof $this->type) {
            parent::offsetSet($index, $newval);

            return;
        }

        if ($this->allowedTypes[$this->type]($newval)) {
            parent::offsetSet($index, $newval);

            return;
        }

        throw new InvalidArgumentException(__CLASS__.': Elements passed to '.__CLASS__.' must be of the type '.$this->type.'.');
    }
public function offsetSet($index, $newval)
    {
        if ($newval instanceof $this->type) {
            parent::offsetSet($index, $newval);

            return;
        }

        if ($this->allowedTypes[$this->type]($newval)) {
            parent::offsetSet($index, $newval);

            return;
        }

        throw new InvalidArgumentException(__CLASS__.': Elements passed to '.__CLASS__.' must be of the type '.$this->type.'.');
    }
public function offsetSet ( $ index , $ newval ) { if ( $ newval instanceof $ this -> type ) { parent :: offsetSet ( $ index , $ newval ) ; return ; } if ( $ this -> allowedTypes [ $ this -> type ] ( $ newval ) ) { parent :: offsetSet ( $ index , $ newval ) ; return ; } throw new InvalidArgumentException ( __CLASS__ . ': Elements passed to ' . __CLASS__ . ' must be of the type ' . $ this -> type . '.' ) ; }
Array style value assignment.

@ignore

@param mixed $index
@param mixed $newval

@throws InvalidArgumentException If value passed with $newval are not of the configured type

@return void
Array style value assignment .