3v4l.org

run code in 300+ PHP versions simultaneously
<?php $t = range(1, 32, 1); while (!empty($t) && count($g) < 4) { $key = array_rand($t); $g[] = $t[$key]; unset($t[$key]); } var_dump($g);

preferences:
33.82 ms | 402 KiB | 5 Q