3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = new class implements \ArrayAccess { public function offsetExists($offset) { echo "offsetExists\n"; } public function offsetGet($offset) { echo "offsetGet\n"; } public function offsetSet($offset, $value) { } public function offsetUnset($offset) { } }; echo "isset:\n"; isset($data['foo']) ? NULL : NULL; echo "null coalescing operator:\n"; $data['foo'] ?? NULL;

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
161.67 ms | 3034 KiB | 8 Q