3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements ArrayAccess { function offsetGet($a){ return new A; } function offsetExists($a){ echo "exists"; if($a === 10){ return true; }else{ return false; } } function offsetSet($a, $b){} function offsetUnset($a){} } $x = new A; var_dump($x[10][20] ?? 20);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
172.26 ms | 2547 KiB | 11 Q