3v4l.org

run code in 300+ PHP versions simultaneously
<?php $img = ["-1" => "/images/image2.jpg", "0" => "/images/image3.jpg", "1" => "/images/image1.jmp"]; $number = 0; Echo ($number == 0 ? $img[$number] : $img[$number/abs($number)]);

preferences:
22.71 ms | 404 KiB | 5 Q