3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $numbers = range(1, 20); shuffle($numbers); function UniqueRandomNumbersWithinRange($min, $max, $quantity) { $numbers = range($min, $max); shuffle($numbers); return array_slice($numbers, 0, $quantity); } print_r( UniqueRandomNumbersWithinRange(0,200,1) ); ?>
based on hE4NG
Output for 7.1.0
Array ( [0] => 2 )
Output for 5.6.28
Array ( [0] => 109 )