public function contains($element) { $elementKey = static::getElementKey($element); return isset($this->array[$elementKey]) || array_key_exists($elementKey, $this->array); }