position = 0; $this->array = $arr; $this->key = $key; } function rewind() { $this->position = 0; } function current() { return $this->array[$this->position]; } function key() { return $this->key; } function next() { ++$this->position; } function valid() { return isset($this->array[$this->position]); } } $years = new SameKeyArray(array(2007,2009), 'year');