3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lookup = [ null, "Good", "Bad", "Ugly" ]; foreach (range(0, 5) as $test) { echo $test , ' : ' , ($lookup[$test] ?? $lookup[0]) , "\n"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
186.14 ms | 2351 KiB | 11 Q