3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = range(1, 99); // numbers to pick from $length = 5; // amount of items in the set $sets_amount = 200; // amount of sets you want to generate $existing = array(); // where we store existing sets $shuffle_period = count($numbers) - $length - 1; // how often we re-randomize the elements $j = 0; for ($i = 0; $i < $sets_amount; $i++, $j++) { if (!($i % $shuffle_period)) { shuffle($numbers); // randomize at first go and on $shuffle_period $j = 0; } do { $arr = array_slice($numbers, $j, $length); } while (in_array($arr, $existing)); $existing[] = $arr; } print_r($existing); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0040.00817.09
7.1.60.0070.00717.05
7.1.50.0080.01217.12
7.1.40.0060.00916.55
7.1.30.0040.01316.60
7.1.20.0140.01016.57
7.1.10.0050.00516.73
7.1.00.0060.01216.79
7.0.200.0080.01216.52
7.0.190.0100.02016.47
7.0.180.0080.01416.03
7.0.170.0220.00716.29
7.0.160.0220.02216.47
7.0.150.0040.01516.47
7.0.140.0080.01516.47
7.0.130.0140.01916.69
7.0.120.0070.01416.57
7.0.110.0140.00316.47
7.0.100.0100.01316.53
7.0.90.0200.01316.50
7.0.80.0160.01616.58
7.0.70.0040.01216.62
7.0.60.0180.00416.50
7.0.50.0150.00616.51
7.0.40.0140.02416.50
7.0.30.0140.01116.50
7.0.20.0120.01216.50
7.0.10.0080.01116.50
7.0.00.0140.00716.50
5.6.300.0160.05920.77
5.6.290.0130.05920.75
5.6.280.0070.04920.85
5.6.270.0170.03721.04
5.6.260.0260.06821.13
5.6.250.0100.04720.92
5.6.240.0170.08320.98
5.6.230.0030.05121.00
5.6.220.0100.08820.69
5.6.210.0100.05121.01
5.6.200.0100.06520.83
5.6.190.0110.05221.08
5.6.180.0200.05320.70
5.6.170.0190.05620.64
5.6.160.0240.05020.68
5.6.150.0240.03321.03
5.6.140.0170.07020.78
5.6.130.0180.05020.88
5.6.120.0100.05220.73
5.6.110.0100.04820.80
5.6.100.0090.04720.78
5.6.90.0040.06420.77
5.6.80.0090.04920.20
5.6.70.0170.07320.02
5.6.60.0130.04320.18
5.6.50.0110.09920.30
5.6.40.0130.04220.30
5.6.30.0130.04320.09
5.6.20.0140.05820.35
5.6.10.0320.04220.09
5.6.00.0220.07720.35
5.5.380.0270.05417.57
5.5.370.0170.08917.61
5.5.360.0100.04617.55
5.5.350.0160.05017.57
5.5.340.0110.04618.04
5.5.330.0130.03817.80
5.5.320.0160.04017.96
5.5.310.0070.05717.90
5.5.300.0170.06718.05
5.5.290.0100.04317.96
5.5.280.0100.05018.02
5.5.270.0070.04817.98
5.5.260.0030.06317.95
5.5.250.0100.05117.42
5.5.240.0100.05017.45
5.5.230.0160.04717.13
5.5.220.0070.04317.13
5.5.210.0070.07717.45
5.5.200.0130.05017.34
5.5.190.0160.04117.34
5.5.180.0100.04516.96
5.5.160.0070.04717.27
5.5.150.0100.05217.40
5.5.140.0100.06217.40
5.5.130.0070.04417.31
5.5.120.0070.05717.36
5.5.110.0100.04317.34
5.5.100.0130.03917.32
5.5.90.0100.03917.32
5.5.80.0070.05017.32
5.5.70.0000.05317.27
5.5.60.0140.06117.32
5.5.50.0040.04917.29
5.5.40.0070.04416.99
5.5.30.0140.04217.12
5.5.20.0100.03917.28
5.5.10.0070.04917.03
5.5.00.0070.04417.29
5.4.450.0130.08619.24
5.4.440.0100.04919.29
5.4.430.0130.03719.27
5.4.420.0100.04719.27
5.4.410.0100.04519.25
5.4.400.0100.05318.94
5.4.390.0030.04918.88
5.4.380.0130.08118.88
5.4.370.0030.08118.95
5.4.360.0100.04219.10
5.4.350.0100.03718.91
5.4.340.0070.07018.88
5.4.320.0100.06519.04
5.4.310.0070.08218.79
5.4.300.0160.03218.89
5.4.290.0030.04918.95
5.4.280.0070.04818.88
5.4.270.0130.04018.88
5.4.260.0130.06919.08
5.4.250.0230.04719.10
5.4.240.0170.07418.90
5.4.230.0140.03719.07
5.4.220.0100.04618.81
5.4.210.0330.04319.04
5.4.200.0100.04218.90
5.4.190.0100.03718.87
5.4.180.0100.03719.07
5.4.170.0100.04318.87
5.4.160.0070.04419.05
5.4.150.0370.02718.86
5.4.140.0180.03916.61
5.4.130.0100.04416.61
5.4.120.0070.03816.69
5.4.110.0130.04016.75
5.4.100.0100.04016.66
5.4.90.0070.05716.62
5.4.80.0110.03616.80
5.4.70.0030.06516.61
5.4.60.0170.04316.61
5.4.50.0070.04116.68
5.4.40.0160.03316.61
5.4.30.0130.03016.71
5.4.20.0160.03516.76
5.4.10.0070.05316.68
5.4.00.0100.04716.61
5.3.290.0130.05416.61
5.3.280.0100.08416.61
5.3.270.0170.05016.61
5.3.260.0170.03416.61
5.3.250.0130.04616.61
5.3.240.0030.04216.61
5.3.230.0070.04316.61
5.3.220.0130.06716.61
5.3.210.0130.03716.61
5.3.200.0130.04816.61
5.3.190.0100.04116.61
5.3.180.0070.04016.61
5.3.170.0130.03916.61
5.3.160.0100.04316.61
5.3.150.0070.04416.61
5.3.140.0100.04116.61
5.3.130.0060.04816.61
5.3.120.0070.04516.61
5.3.110.0070.04416.61
5.3.100.0070.04316.61
5.3.90.0100.03616.61
5.3.80.0060.04216.61
5.3.70.0070.04116.61
5.3.60.0070.04116.61
5.3.50.0030.04716.61
5.3.40.0070.04416.61
5.3.30.0140.03816.61
5.3.20.0320.02916.61
5.3.10.0030.05116.61
5.3.00.0070.05916.61
5.2.170.0070.03816.61
5.2.160.0070.03816.61
5.2.150.0170.03716.61
5.2.140.0070.03316.61
5.2.130.0130.03016.61
5.2.120.0170.06416.61
5.2.110.0100.04216.61
5.2.100.0070.04416.61
5.2.90.0340.02316.61
5.2.80.0070.04816.61
5.2.70.0070.04416.61
5.2.60.0130.02616.61
5.2.50.0130.02916.61
5.2.40.0100.05016.61
5.2.30.0070.03416.61
5.2.20.0170.03316.61
5.2.10.0100.03116.61
5.2.00.0320.02616.61
5.1.60.0070.03616.61
5.1.50.0170.02316.61
5.1.40.0100.02416.61
5.1.30.0100.03416.61
5.1.20.0070.03016.61
5.1.10.0100.03316.61
5.1.00.0070.03116.61
5.0.50.0120.01916.61
5.0.40.0030.03016.61
5.0.30.0130.03316.61
5.0.20.0130.02216.61
5.0.10.0150.02016.61
5.0.00.0110.03916.61
4.4.90.0070.01816.61
4.4.80.0060.01916.61
4.4.70.0140.03516.61
4.4.60.0070.02416.61
4.4.50.0100.01716.61
4.4.40.0130.02616.61
4.4.30.0070.01716.61
4.4.20.0070.02116.61
4.4.10.0090.01816.61
4.4.00.0070.03116.61
4.3.110.0110.01816.61
4.3.100.0070.01716.61
4.3.90.0070.02016.61
4.3.80.0110.02516.61
4.3.70.0110.01816.61
4.3.60.0070.01916.61
4.3.50.0070.02016.61
4.3.40.0130.02916.61
4.3.30.0090.01616.61
4.3.20.0030.02616.61
4.3.10.0070.02116.61
4.3.00.0130.01316.61

preferences:
31.27 ms | 400 KiB | 5 Q