3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements ArrayAccess{ function offsetGet($foo){ print_r($foo); } function offsetSet($x, $v){ print_r($x); print_r($v); } function offsetUnset($x){ print_r($x); } function offsetExists($x){ print_r($x); } } $x = new A; $x[new ArrayObject] = "x";

preferences:
37.83 ms | 402 KiB | 5 Q