3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements ArrayAccess { public function offsetSet($offset, $value) { var_dump($offset); } public function offsetGet($offset){} public function offsetUnset($offset){} public function offsetExists($offset){} } $test = new Test(); $test[7.3982] = true; $test[new \stdClass()] = true; $x[7.3982] = true; var_dump($x);

preferences:
23.92 ms | 402 KiB | 5 Q