public function remove($key)
    {
        if ($key instanceof UniqueId) {
            $key = $key->id();
        }

        return $this->elements->remove($key);
    }
public function remove($key)
    {
        if ($key instanceof UniqueId) {
            $key = $key->id();
        }

        return $this->elements->remove($key);
    }
public function remove ( $ key ) { if ( $ key instanceof UniqueId ) { $ key = $ key -> id ( ) ; } return $ this -> elements -> remove ( $ key ) ; }
Removes the element at the specified index from the collection.

@param string|integer $key The kex/index of the element to remove.

@return mixed The removed element or NULL, if the collection did not contain the element.
Removes the element at the specified index from the collection .