3v4l.org

run code in 300+ PHP versions simultaneously
<?php $seats = 7; $booked_seat = array('1','4','5','6','7'); $booked_a = array_flip($booked_seat); for ($i=1; $i <= $seats; $i++) { printf("seat: %d%s\n", $i, isset($booked_a[$i]) ? " booked" : ""); }

preferences:
36.52 ms | 405 KiB | 5 Q