3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function randomGen($min, $max, $quantity) { $numbers = range($min, $max); shuffle($numbers); return array_slice($numbers, 0, $quantity); } $y = randomGen(0,12,12); $y = range(0,12); print_r($y) ?>
Output for 4.3.0 - 7.1.0
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [10] => 10 [11] => 11 [12] => 12 )