3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $maxId = 10; $n = 10; // If there are less urls in the db then required, lower the requirements $n = $maxId < $n ? $maxId : $n; $randomIds = []; while (count($randomIds) < $n) { $randomId = rand(1, $maxId); if (!in_array($randomId, $randomIds)) { $randomIds[] = $randomId; } } var_dump($randomIds);
based on IBGP3
Output for 7.2.6
array(10) { [0]=> int(1) [1]=> int(9) [2]=> int(3) [3]=> int(6) [4]=> int(8) [5]=> int(4) [6]=> int(2) [7]=> int(10) [8]=> int(5) [9]=> int(7) }
Output for 7.2.0
array(10) { [0]=> int(4) [1]=> int(9) [2]=> int(8) [3]=> int(3) [4]=> int(7) [5]=> int(10) [6]=> int(6) [7]=> int(5) [8]=> int(1) [9]=> int(2) }
Output for 7.1.10
array(10) { [0]=> int(5) [1]=> int(9) [2]=> int(1) [3]=> int(7) [4]=> int(10) [5]=> int(4) [6]=> int(2) [7]=> int(6) [8]=> int(8) [9]=> int(3) }
Output for 7.1.7
array(10) { [0]=> int(7) [1]=> int(10) [2]=> int(8) [3]=> int(5) [4]=> int(6) [5]=> int(1) [6]=> int(4) [7]=> int(9) [8]=> int(3) [9]=> int(2) }
Output for 7.1.6
array(10) { [0]=> int(7) [1]=> int(1) [2]=> int(8) [3]=> int(4) [4]=> int(10) [5]=> int(3) [6]=> int(6) [7]=> int(5) [8]=> int(2) [9]=> int(9) }
Output for 7.1.5
array(10) { [0]=> int(8) [1]=> int(6) [2]=> int(4) [3]=> int(7) [4]=> int(10) [5]=> int(3) [6]=> int(9) [7]=> int(1) [8]=> int(2) [9]=> int(5) }
Output for 7.1.4
array(10) { [0]=> int(7) [1]=> int(8) [2]=> int(1) [3]=> int(5) [4]=> int(10) [5]=> int(3) [6]=> int(6) [7]=> int(4) [8]=> int(2) [9]=> int(9) }
Output for 7.1.3
array(10) { [0]=> int(6) [1]=> int(8) [2]=> int(4) [3]=> int(5) [4]=> int(3) [5]=> int(9) [6]=> int(10) [7]=> int(2) [8]=> int(7) [9]=> int(1) }
Output for 7.1.2
array(10) { [0]=> int(2) [1]=> int(6) [2]=> int(5) [3]=> int(9) [4]=> int(8) [5]=> int(3) [6]=> int(7) [7]=> int(4) [8]=> int(1) [9]=> int(10) }
Output for 7.1.1
array(10) { [0]=> int(3) [1]=> int(9) [2]=> int(10) [3]=> int(2) [4]=> int(1) [5]=> int(5) [6]=> int(7) [7]=> int(6) [8]=> int(8) [9]=> int(4) }
Output for 7.1.0
array(10) { [0]=> int(8) [1]=> int(1) [2]=> int(5) [3]=> int(2) [4]=> int(9) [5]=> int(3) [6]=> int(7) [7]=> int(4) [8]=> int(6) [9]=> int(10) }
Output for 7.0.20
array(10) { [0]=> int(5) [1]=> int(6) [2]=> int(1) [3]=> int(8) [4]=> int(3) [5]=> int(9) [6]=> int(2) [7]=> int(7) [8]=> int(4) [9]=> int(10) }
Output for 7.0.19
array(10) { [0]=> int(1) [1]=> int(8) [2]=> int(7) [3]=> int(10) [4]=> int(2) [5]=> int(3) [6]=> int(4) [7]=> int(5) [8]=> int(9) [9]=> int(6) }
Output for 7.0.18
array(10) { [0]=> int(9) [1]=> int(5) [2]=> int(3) [3]=> int(2) [4]=> int(10) [5]=> int(8) [6]=> int(6) [7]=> int(7) [8]=> int(1) [9]=> int(4) }
Output for 7.0.17
array(10) { [0]=> int(8) [1]=> int(9) [2]=> int(6) [3]=> int(1) [4]=> int(3) [5]=> int(10) [6]=> int(5) [7]=> int(4) [8]=> int(7) [9]=> int(2) }
Output for 7.0.16
array(10) { [0]=> int(2) [1]=> int(7) [2]=> int(1) [3]=> int(9) [4]=> int(5) [5]=> int(10) [6]=> int(6) [7]=> int(3) [8]=> int(8) [9]=> int(4) }
Output for 7.0.15
array(10) { [0]=> int(4) [1]=> int(8) [2]=> int(9) [3]=> int(10) [4]=> int(6) [5]=> int(5) [6]=> int(7) [7]=> int(3) [8]=> int(2) [9]=> int(1) }
Output for 7.0.14
array(10) { [0]=> int(1) [1]=> int(2) [2]=> int(5) [3]=> int(3) [4]=> int(4) [5]=> int(8) [6]=> int(10) [7]=> int(6) [8]=> int(7) [9]=> int(9) }
Output for 7.0.13
array(10) { [0]=> int(7) [1]=> int(6) [2]=> int(5) [3]=> int(3) [4]=> int(1) [5]=> int(9) [6]=> int(10) [7]=> int(8) [8]=> int(4) [9]=> int(2) }
Output for 7.0.12
array(10) { [0]=> int(1) [1]=> int(5) [2]=> int(7) [3]=> int(8) [4]=> int(2) [5]=> int(3) [6]=> int(6) [7]=> int(9) [8]=> int(10) [9]=> int(4) }
Output for 7.0.11
array(10) { [0]=> int(10) [1]=> int(7) [2]=> int(8) [3]=> int(5) [4]=> int(4) [5]=> int(3) [6]=> int(2) [7]=> int(1) [8]=> int(6) [9]=> int(9) }
Output for 7.0.10
array(10) { [0]=> int(5) [1]=> int(4) [2]=> int(1) [3]=> int(9) [4]=> int(7) [5]=> int(8) [6]=> int(6) [7]=> int(10) [8]=> int(2) [9]=> int(3) }
Output for 7.0.9
array(10) { [0]=> int(1) [1]=> int(10) [2]=> int(9) [3]=> int(8) [4]=> int(6) [5]=> int(2) [6]=> int(5) [7]=> int(3) [8]=> int(7) [9]=> int(4) }
Output for 7.0.8
array(10) { [0]=> int(10) [1]=> int(3) [2]=> int(8) [3]=> int(9) [4]=> int(4) [5]=> int(1) [6]=> int(2) [7]=> int(6) [8]=> int(7) [9]=> int(5) }
Output for 7.0.7
array(10) { [0]=> int(1) [1]=> int(4) [2]=> int(5) [3]=> int(7) [4]=> int(9) [5]=> int(8) [6]=> int(2) [7]=> int(6) [8]=> int(10) [9]=> int(3) }
Output for 7.0.6
array(10) { [0]=> int(4) [1]=> int(9) [2]=> int(2) [3]=> int(6) [4]=> int(8) [5]=> int(10) [6]=> int(1) [7]=> int(5) [8]=> int(3) [9]=> int(7) }
Output for 7.0.5
array(10) { [0]=> int(9) [1]=> int(2) [2]=> int(7) [3]=> int(1) [4]=> int(4) [5]=> int(6) [6]=> int(10) [7]=> int(8) [8]=> int(3) [9]=> int(5) }
Output for 7.0.4
array(10) { [0]=> int(3) [1]=> int(6) [2]=> int(8) [3]=> int(9) [4]=> int(1) [5]=> int(7) [6]=> int(4) [7]=> int(5) [8]=> int(2) [9]=> int(10) }
Output for 7.0.3
array(10) { [0]=> int(3) [1]=> int(2) [2]=> int(4) [3]=> int(9) [4]=> int(8) [5]=> int(1) [6]=> int(5) [7]=> int(10) [8]=> int(6) [9]=> int(7) }
Output for 7.0.2
array(10) { [0]=> int(8) [1]=> int(5) [2]=> int(2) [3]=> int(3) [4]=> int(10) [5]=> int(7) [6]=> int(6) [7]=> int(9) [8]=> int(4) [9]=> int(1) }
Output for 7.0.1
array(10) { [0]=> int(1) [1]=> int(10) [2]=> int(2) [3]=> int(3) [4]=> int(8) [5]=> int(9) [6]=> int(4) [7]=> int(7) [8]=> int(5) [9]=> int(6) }
Output for 7.0.0
array(10) { [0]=> int(5) [1]=> int(3) [2]=> int(7) [3]=> int(8) [4]=> int(6) [5]=> int(4) [6]=> int(2) [7]=> int(10) [8]=> int(9) [9]=> int(1) }
Output for hhvm-3.15.4
array(10) { [0]=> int(3) [1]=> int(8) [2]=> int(2) [3]=> int(6) [4]=> int(10) [5]=> int(5) [6]=> int(4) [7]=> int(1) [8]=> int(9) [9]=> int(7) }
Output for 5.6.30
array(10) { [0]=> int(6) [1]=> int(8) [2]=> int(1) [3]=> int(4) [4]=> int(10) [5]=> int(2) [6]=> int(3) [7]=> int(9) [8]=> int(5) [9]=> int(7) }
Output for 5.6.29
array(10) { [0]=> int(7) [1]=> int(10) [2]=> int(6) [3]=> int(5) [4]=> int(4) [5]=> int(9) [6]=> int(2) [7]=> int(3) [8]=> int(1) [9]=> int(8) }
Output for 5.6.28
array(10) { [0]=> int(8) [1]=> int(7) [2]=> int(2) [3]=> int(1) [4]=> int(5) [5]=> int(9) [6]=> int(6) [7]=> int(10) [8]=> int(3) [9]=> int(4) }
Output for 5.6.27
array(10) { [0]=> int(2) [1]=> int(8) [2]=> int(5) [3]=> int(3) [4]=> int(9) [5]=> int(1) [6]=> int(6) [7]=> int(4) [8]=> int(7) [9]=> int(10) }
Output for 5.6.26
array(10) { [0]=> int(1) [1]=> int(5) [2]=> int(6) [3]=> int(4) [4]=> int(2) [5]=> int(3) [6]=> int(9) [7]=> int(8) [8]=> int(7) [9]=> int(10) }
Output for 5.6.25
array(10) { [0]=> int(4) [1]=> int(8) [2]=> int(5) [3]=> int(10) [4]=> int(7) [5]=> int(1) [6]=> int(9) [7]=> int(3) [8]=> int(6) [9]=> int(2) }
Output for 5.6.24
array(10) { [0]=> int(10) [1]=> int(9) [2]=> int(6) [3]=> int(7) [4]=> int(3) [5]=> int(1) [6]=> int(8) [7]=> int(5) [8]=> int(2) [9]=> int(4) }
Output for 5.6.23
array(10) { [0]=> int(6) [1]=> int(3) [2]=> int(1) [3]=> int(8) [4]=> int(4) [5]=> int(5) [6]=> int(9) [7]=> int(10) [8]=> int(7) [9]=> int(2) }
Output for 5.6.22
array(10) { [0]=> int(7) [1]=> int(6) [2]=> int(5) [3]=> int(9) [4]=> int(10) [5]=> int(2) [6]=> int(8) [7]=> int(4) [8]=> int(1) [9]=> int(3) }
Output for 5.6.21
array(10) { [0]=> int(1) [1]=> int(4) [2]=> int(9) [3]=> int(5) [4]=> int(7) [5]=> int(8) [6]=> int(2) [7]=> int(6) [8]=> int(10) [9]=> int(3) }
Output for 5.6.20
array(10) { [0]=> int(10) [1]=> int(2) [2]=> int(8) [3]=> int(4) [4]=> int(5) [5]=> int(3) [6]=> int(9) [7]=> int(7) [8]=> int(1) [9]=> int(6) }
Output for 5.6.19
array(10) { [0]=> int(7) [1]=> int(6) [2]=> int(1) [3]=> int(2) [4]=> int(4) [5]=> int(3) [6]=> int(5) [7]=> int(8) [8]=> int(10) [9]=> int(9) }
Output for 5.6.18
array(10) { [0]=> int(7) [1]=> int(5) [2]=> int(10) [3]=> int(4) [4]=> int(8) [5]=> int(3) [6]=> int(6) [7]=> int(2) [8]=> int(1) [9]=> int(9) }
Output for 5.6.17
array(10) { [0]=> int(2) [1]=> int(10) [2]=> int(5) [3]=> int(4) [4]=> int(8) [5]=> int(7) [6]=> int(9) [7]=> int(6) [8]=> int(3) [9]=> int(1) }
Output for 5.6.16
array(10) { [0]=> int(10) [1]=> int(4) [2]=> int(7) [3]=> int(5) [4]=> int(1) [5]=> int(2) [6]=> int(3) [7]=> int(8) [8]=> int(6) [9]=> int(9) }
Output for 5.6.15
array(10) { [0]=> int(2) [1]=> int(10) [2]=> int(7) [3]=> int(5) [4]=> int(8) [5]=> int(1) [6]=> int(4) [7]=> int(9) [8]=> int(6) [9]=> int(3) }
Output for 5.6.14
array(10) { [0]=> int(7) [1]=> int(2) [2]=> int(9) [3]=> int(10) [4]=> int(8) [5]=> int(4) [6]=> int(1) [7]=> int(6) [8]=> int(3) [9]=> int(5) }
Output for 5.6.13
array(10) { [0]=> int(3) [1]=> int(1) [2]=> int(4) [3]=> int(7) [4]=> int(9) [5]=> int(6) [6]=> int(8) [7]=> int(5) [8]=> int(10) [9]=> int(2) }
Output for 5.6.12
array(10) { [0]=> int(8) [1]=> int(7) [2]=> int(2) [3]=> int(5) [4]=> int(10) [5]=> int(1) [6]=> int(3) [7]=> int(6) [8]=> int(9) [9]=> int(4) }
Output for 5.6.11
array(10) { [0]=> int(5) [1]=> int(10) [2]=> int(4) [3]=> int(9) [4]=> int(2) [5]=> int(8) [6]=> int(1) [7]=> int(6) [8]=> int(7) [9]=> int(3) }
Output for 5.6.10
array(10) { [0]=> int(4) [1]=> int(6) [2]=> int(10) [3]=> int(2) [4]=> int(8) [5]=> int(9) [6]=> int(1) [7]=> int(3) [8]=> int(5) [9]=> int(7) }
Output for 5.6.9
array(10) { [0]=> int(4) [1]=> int(9) [2]=> int(3) [3]=> int(2) [4]=> int(7) [5]=> int(8) [6]=> int(5) [7]=> int(10) [8]=> int(6) [9]=> int(1) }
Output for 5.6.8
array(10) { [0]=> int(1) [1]=> int(5) [2]=> int(3) [3]=> int(8) [4]=> int(9) [5]=> int(10) [6]=> int(2) [7]=> int(7) [8]=> int(4) [9]=> int(6) }
Output for 5.6.7
array(10) { [0]=> int(6) [1]=> int(7) [2]=> int(8) [3]=> int(9) [4]=> int(10) [5]=> int(4) [6]=> int(3) [7]=> int(2) [8]=> int(5) [9]=> int(1) }
Output for 5.6.6
array(10) { [0]=> int(2) [1]=> int(7) [2]=> int(9) [3]=> int(6) [4]=> int(8) [5]=> int(4) [6]=> int(10) [7]=> int(3) [8]=> int(1) [9]=> int(5) }
Output for 5.6.5
array(10) { [0]=> int(10) [1]=> int(4) [2]=> int(1) [3]=> int(6) [4]=> int(7) [5]=> int(2) [6]=> int(8) [7]=> int(3) [8]=> int(5) [9]=> int(9) }
Output for 5.6.4
array(10) { [0]=> int(1) [1]=> int(10) [2]=> int(7) [3]=> int(6) [4]=> int(4) [5]=> int(3) [6]=> int(9) [7]=> int(5) [8]=> int(2) [9]=> int(8) }
Output for 5.6.3
array(10) { [0]=> int(5) [1]=> int(2) [2]=> int(8) [3]=> int(3) [4]=> int(7) [5]=> int(1) [6]=> int(9) [7]=> int(6) [8]=> int(10) [9]=> int(4) }
Output for 5.6.2
array(10) { [0]=> int(9) [1]=> int(1) [2]=> int(6) [3]=> int(3) [4]=> int(5) [5]=> int(10) [6]=> int(8) [7]=> int(4) [8]=> int(7) [9]=> int(2) }
Output for 5.6.1
array(10) { [0]=> int(2) [1]=> int(9) [2]=> int(8) [3]=> int(7) [4]=> int(5) [5]=> int(3) [6]=> int(10) [7]=> int(4) [8]=> int(1) [9]=> int(6) }
Output for 5.6.0
array(10) { [0]=> int(1) [1]=> int(7) [2]=> int(10) [3]=> int(9) [4]=> int(4) [5]=> int(6) [6]=> int(5) [7]=> int(2) [8]=> int(3) [9]=> int(8) }