3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test implements arrayaccess { public function offsetSet($offset, $value) { var_dump($offset); var_dump($value); } public function offsetExists($offset) { return isset($this->container[$offset]); } public function offsetUnset($offset) { unset($this->container[$offset]); } public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $test = new test(); $test->a[5] = 12345;

preferences:
36.56 ms | 402 KiB | 5 Q