3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tstart = microtime(true); $numberOfRandoms = 500; $uniques = array(); for($i = 0; $i < $numberOfRandoms; $i++) { do { $code = mt_rand(10000,99999); } while(in_array($code, $uniques)); $uniques[] = $code; } $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; $tstart = microtime(true); $numberOfRandoms = 500; $uniques = array(); do { $uniques[mt_rand(10000, 99999)] = true; } while(count(array_keys($uniques)) < $numberOfRandoms); $uniques = array_keys($uniques); $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; $tstart = microtime(true); $uniques = range(10000, 99999); shuffle($uniques); $uniques = array_slice($uniques, 0, 500); $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL;

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.2.00.0030.01023.19
7.1.70.0040.01121.21
7.1.60.0140.02121.13
7.1.50.0220.02238.67
7.1.00.0100.07726.20
7.0.200.1010.01019.22
7.0.140.0030.07725.95
7.0.60.0000.06322.59
7.0.50.0100.08320.38
7.0.40.0030.04722.36
7.0.30.0470.08322.42
7.0.20.0330.08322.43
7.0.10.0070.07322.29
7.0.00.0100.04722.38
5.6.280.0130.11734.71
5.6.210.0170.10334.34
5.6.200.0070.09031.75
5.6.190.0200.12733.84
5.6.180.0230.10033.99
5.6.170.0370.12333.99
5.6.160.0130.12733.87
5.6.150.0070.13031.62
5.6.140.0100.08031.75
5.6.130.0100.09731.66
5.6.120.0070.13734.59
5.6.110.0070.13034.57
5.6.100.0170.08034.63
5.6.90.0230.12034.73
5.6.80.0100.07333.98
5.6.70.4270.07034.06
5.5.350.0270.11733.97
5.5.340.0030.08031.63
5.5.330.0070.13733.64
5.5.320.0070.13333.66
5.5.310.0330.09733.61
5.5.300.0030.10331.47
5.5.290.0170.12731.55
5.5.280.0130.07734.37
5.5.270.0200.08334.32
5.5.260.0200.13034.46
5.5.250.0030.10034.29
5.5.240.0170.08033.83
5.4.450.0370.12032.86
5.4.440.0330.09732.76
5.4.430.0200.09332.93
5.4.420.0230.07032.93
5.4.410.0300.07032.77
5.4.400.0270.07332.34
5.4.390.0170.08032.74
5.4.380.0230.07332.57
5.4.370.0300.06732.59
5.4.360.0300.07732.41
5.4.350.0300.06732.78
5.4.340.0330.06732.55
5.4.320.0330.11332.75
5.4.310.0270.11732.60
5.4.300.0230.12332.45
5.4.290.0330.12332.45
5.4.280.0370.10732.64
5.4.270.0370.11332.78
5.4.260.0330.06732.45
5.4.250.0330.12032.30
5.4.240.0430.09032.73
5.4.230.0270.08732.31
5.4.220.0330.10732.45
5.4.210.0200.14032.61
5.4.200.0400.11032.38
5.4.190.0330.07732.57
5.4.180.0370.11732.55
5.4.170.0330.08732.55
5.4.160.0370.12032.26
5.4.150.0400.10032.56
5.4.140.0370.11030.03
5.4.130.0370.11029.81
5.4.120.0300.07729.73
5.4.110.0300.07029.64
5.4.100.0300.07329.95
5.4.90.0230.07729.99
5.4.80.0530.10029.78
5.4.70.0300.06729.96
5.4.60.0430.10029.91
5.4.50.0270.12029.59
5.4.40.0430.10729.87
5.4.30.0370.11330.04
5.4.20.0500.11329.98
5.4.10.0330.10730.00
5.4.00.0330.11729.18
5.3.290.0270.12327.70
5.3.280.0370.11027.70
5.3.270.0430.11027.76
5.3.260.0300.08027.61
5.3.250.0400.11327.70
5.3.240.0430.07727.57
5.3.230.0500.10327.64
5.3.220.0400.11327.70
5.3.210.0270.08327.70
5.3.200.0370.09727.70
5.3.190.0400.12727.61
5.3.180.0300.07327.59
5.3.170.0370.13027.58
5.3.160.0370.11027.61
5.3.150.0230.12027.70
5.3.140.0300.10327.61
5.3.130.0300.12327.57
5.3.120.0430.11027.68
5.3.110.0530.10327.65
5.3.100.0370.07027.04
5.3.90.0330.10027.03
5.3.80.0370.11027.04
5.3.70.0370.12327.38
5.3.60.0330.11327.03
5.3.50.0270.08726.95
5.3.40.0400.09327.05
5.3.30.0300.11326.96
5.3.20.0270.09726.93
5.3.10.0430.11026.91
5.3.00.0400.11326.65
5.2.170.0200.10723.46
5.2.160.0330.10323.41
5.2.150.0270.11023.47
5.2.140.0270.10723.60
5.2.130.0230.06723.50
5.2.120.0400.10323.51
5.2.110.0230.10323.52
5.2.100.0300.11023.36
5.2.90.0300.10023.51
5.2.80.0230.11323.34
5.2.70.0430.09723.34
5.2.60.0170.07023.36
5.2.50.0330.08023.39
5.2.40.0270.10323.34
5.2.30.0300.07323.33
5.2.20.0200.10723.27
5.2.10.0370.09723.29
5.2.00.0200.07323.08
5.1.60.0170.07026.45
5.1.50.0330.10026.54
5.1.40.0270.11726.71
5.1.30.0370.07726.88
5.1.20.0330.08327.13
5.1.10.0330.10026.56
5.1.00.0430.10026.55
5.0.50.0200.10725.16
5.0.40.0330.08724.85
5.0.30.0170.08724.71
5.0.20.0200.08724.73
5.0.10.0130.11724.70
5.0.00.0130.13024.94
4.4.90.0100.10722.53
4.4.80.0130.10022.51
4.4.70.0100.07022.50
4.4.60.0170.08722.63
4.4.50.0200.10722.62
4.4.40.0130.08022.52
4.4.30.0200.07022.61
4.4.20.0100.07022.54
4.4.10.0200.10022.67
4.4.00.0130.11722.55
4.3.110.0170.10022.41
4.3.100.0170.10722.55
4.3.90.0200.10022.44
4.3.80.0130.08722.40
4.3.70.0130.09022.46
4.3.60.0200.08322.46
4.3.50.0130.08722.39
4.3.40.0100.07022.41
4.3.30.0100.05721.18
4.3.20.0130.05721.23
4.3.10.0100.10021.19
4.3.00.0200.08721.08

preferences:
32.2 ms | 401 KiB | 5 Q