private function validateIndex($index) { $exists = $this->indexExists($index); if (!$exists) { throw new OutOfRangeException("Index out of bounds of collection"); } }