rendered paste body<?phpclass SameKeyArray implements Iterator{ private $position = 0; private $array = array(); private $key = ''; public function __construct( $arr, $key ) { $this->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');