public function getPage($index) { // redefine $index = (int) $index; // does the index exists if (isset($this->pages[$index])) { return $this->pages[$index]; } // fallback return; }