code: public function remove($element)
      {
          if (!$this->contains($element)) {
              return false;
          }
  
          $this->offsetUnset($this->indexOf($element));
  
          return true;
      }
docs: Remove element from collection
  
  @param $element
  @return bool