Someone
public text v1 · immutable<?php
class MyArray implements ArrayAccess {
private $real;
public function __construct($in) { $this->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]);