3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $nums = []; for ($i = 1; $i <= 24; $i++) { $nums[] = $i; } $days = []; foreach ($nums as $num) { $day = array_rand($nums); $days[$day] = $day; unset($nums[$day]); }
Output for 7.1.23