real = $in; } public function offsetExists($offset) { } public function offsetGet($offset) { if (is_array($this->real) && isset($this->real[$offset])) return $this->real[$offset]; } public function offsetSet($offset, $value) { } public function offsetUnset($offset) { } } $a = new MyArray(range(0,9)); var_dump($a[0]);