3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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; $tstart = microtime(true); $uniques = array(); for($i = 0; $i < 500; $i++) { do { $code = mt_rand(10000, 99999); } while(in_array($code, $uniques)); $uniques[] = $code } $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)
5.4.320.0060.03512.51
5.4.310.0060.03612.50
5.4.300.0070.04312.51
5.4.290.0090.04612.50
5.4.280.0040.03612.40
5.4.270.0060.03512.40
5.4.260.0070.04012.40
5.4.250.0050.03812.40
5.4.240.0050.04012.40
5.4.230.0060.04812.39
5.4.220.0080.03812.39
5.4.210.0050.04512.39
5.4.200.0070.04212.39
5.4.190.0040.04112.39
5.4.180.0030.04212.39
5.4.170.0050.04612.39
5.4.160.0060.04812.39
5.4.150.0060.04312.39
5.4.140.0070.03712.08
5.4.130.0040.04212.06
5.4.120.0070.04012.03
5.4.110.0120.03312.02
5.4.100.0080.03812.03
5.4.90.0040.04012.02
5.4.80.0090.03812.02
5.4.70.0070.04112.02
5.4.60.0090.04012.02
5.4.50.0080.03712.02
5.4.40.0100.04812.01
5.4.30.0080.03612.00
5.4.20.0060.04712.00
5.4.10.0090.03412.00
5.4.00.0030.04011.49
5.3.290.0050.03912.80
5.3.280.0110.03812.71
5.3.270.0060.04712.73
5.3.260.0050.04312.72
5.3.250.0040.04112.71
5.3.240.0070.04312.72
5.3.230.0060.03812.71
5.3.220.0100.04112.68
5.3.210.0090.04312.68
5.3.200.0090.03812.68
5.3.190.0070.03712.68
5.3.180.0080.03912.67
5.3.170.0100.03512.67
5.3.160.0020.04012.68
5.3.150.0070.04312.67
5.3.140.0080.04012.66
5.3.130.0070.04512.66
5.3.120.0080.04112.66
5.3.110.0100.03812.66
5.3.100.0070.03612.12
5.3.90.0060.04412.08
5.3.80.0070.04012.07
5.3.70.0110.04512.08
5.3.60.0060.04012.06
5.3.50.0040.03912.00
5.3.40.0070.03912.00
5.3.30.0070.03411.96
5.3.20.0070.03911.73
5.3.10.0060.03511.70
5.3.00.0090.03411.70
5.2.170.0080.0289.20
5.2.160.0040.0329.20
5.2.150.0060.0399.20
5.2.140.0050.0339.20
5.2.130.0050.0319.16
5.2.120.0050.0319.15
5.2.110.0030.0359.16
5.2.100.0060.0389.15
5.2.90.0050.0279.15
5.2.80.0050.0369.15
5.2.70.0070.0359.15
5.2.60.0030.0329.11
5.2.50.0060.0339.07
5.2.40.0070.0279.05
5.2.30.0070.0359.03
5.2.20.0070.0289.02
5.2.10.0040.0368.94
5.2.00.0050.0408.79
5.1.60.0040.0298.09
5.1.50.0030.0308.08
5.1.40.0040.0268.06
5.1.30.0040.0268.41
5.1.20.0060.0338.43
5.1.10.0090.0238.16
5.1.00.0050.0378.16
5.0.50.0040.0246.64
5.0.40.0060.0196.50
5.0.30.0030.0316.31
5.0.20.0030.0246.28
5.0.10.0070.0186.26
5.0.00.0040.0346.25
4.4.90.0030.0174.78
4.4.80.0050.0144.76
4.4.70.0010.0174.75
4.4.60.0020.0174.75
4.4.50.0060.0184.77
4.4.40.0010.0274.71
4.4.30.0030.0224.75
4.4.20.0040.0194.84
4.4.10.0040.0174.85
4.4.00.0040.0264.76
4.3.110.0020.0204.67
4.3.100.0020.0184.67
4.3.90.0030.0144.64
4.3.80.0040.0234.58
4.3.70.0010.0174.63
4.3.60.0020.0154.63
4.3.50.0050.0174.63
4.3.40.0040.0254.54
4.3.30.0010.0173.30
4.3.20.0010.0163.28
4.3.10.0030.0223.24
4.3.00.0100.0206.93

preferences:
153.84 ms | 1394 KiB | 7 Q