3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i=0; $i < 100; $i+=1){ $array = generate(); echo "id: $array[0]<br>key: $array[1]<br><br>"; } function generate(){ $char = "0123456789ABCDEFGHJKLMNPQRTUVWXY"; $id = NULL; $id .= substr($char, rand(1, 9), 1); $id .= substr($char, rand(10, 31), 1); $id .= substr($char, rand(10, 31), 1); $id .= substr($char, rand(1, 9), 1); $id .= substr($char, rand(1, 9), 1); $hash = md5($id); $i = 0; $key = NULL; for ($i; $i < 32; $i+=2) { $nchar = hexdec(substr($hash, $i, 2)) & 31; if ((($i % 8) == 0) && ($i > 0)) { $key .= "-".substr($char, $nchar, 1); } else { $key .= substr($char, $nchar, 1); } } $array = array($id, $key); return $array; }

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.00.0070.07322.30
7.0.130.0030.07322.11
7.0.120.0030.07721.97
7.0.110.0100.07322.20
7.0.100.0030.07722.22
7.0.90.0030.07322.13
7.0.80.0000.07722.02
7.0.70.0070.07322.14
7.0.60.0070.07021.92
7.0.50.0030.07022.15
7.0.40.0030.07722.11
7.0.30.0000.07722.10
7.0.20.0000.07322.10
7.0.10.0000.07322.02
7.0.00.0100.09322.16
5.6.280.0100.07020.94
5.6.270.0030.07720.91
5.6.260.0030.07721.04
5.6.250.0000.07321.15
5.6.240.0070.07321.15
5.6.230.0070.07020.82
5.6.220.0070.07320.76
5.6.210.0100.06720.93
5.6.200.0030.08020.89
5.6.190.0070.07021.06
5.6.180.0100.06720.82
5.6.170.0070.09321.05
5.6.160.0070.07321.07
5.6.150.0100.07020.85
5.6.140.0030.08020.88
5.6.130.0000.08021.02
5.6.120.0000.08020.81
5.6.110.0000.08021.07
5.6.100.0000.08321.04
5.6.90.0070.07321.09
5.6.80.0130.06320.46
5.6.70.0070.06320.22
5.6.60.0030.07720.24
5.6.50.0030.07320.27
5.6.40.0030.07020.36
5.6.30.0000.07720.30
5.6.20.0070.07320.41
5.6.10.0100.06720.18
5.6.00.0030.07320.47
5.5.380.0000.07717.68
5.5.370.0030.07317.62
5.5.360.0030.07717.52
5.5.350.0030.07317.56
5.5.340.0030.07317.86
5.5.330.0000.06717.86
5.5.320.0000.10017.90
5.5.310.0000.07717.82
5.5.300.0000.07717.91
5.5.290.0030.07718.23
5.5.280.0070.06318.08
5.5.270.0100.07018.13
5.5.260.0030.07718.16
5.5.250.0100.07017.95
5.5.240.0030.07317.21
5.5.230.0000.07717.53
5.5.220.0000.07317.50
5.5.210.0030.07017.41
5.5.200.0000.07017.64
5.5.190.0030.07317.33
5.5.180.0030.07317.18
5.5.160.0000.07317.43
5.5.150.0000.07017.50
5.5.140.0030.07017.57
5.5.130.0070.06717.21
5.5.120.0030.07017.45
5.5.110.0030.06317.58
5.5.100.0030.07317.12
5.5.90.0070.05317.07
5.5.80.0000.07317.32
5.5.70.0030.06317.33
5.5.60.0070.06717.27
5.5.50.0000.07317.47
5.5.40.0070.06717.38
5.5.30.0000.07317.46
5.5.20.0030.07317.32
5.5.10.0030.07317.14
5.5.00.0000.07717.38
5.4.450.0030.07719.34
5.4.440.0000.06719.32
5.4.430.0000.07719.30
5.4.420.0030.07319.26
5.4.410.0000.07319.11
5.4.400.0000.07318.91
5.4.390.0000.07719.16
5.4.380.0000.07319.31
5.4.370.0070.06719.18
5.4.360.0030.07319.21
5.4.350.0070.06719.21
5.4.340.0070.07019.16
5.4.320.0100.06319.24
5.4.310.0030.07019.23
5.4.300.0000.06719.03
5.4.290.0030.07019.15
5.4.280.0030.07018.88
5.4.270.0070.06719.15
5.4.260.0070.06719.16
5.4.250.0030.07019.01
5.4.240.0000.06719.22
5.4.230.0070.06718.92
5.4.220.0070.06019.14
5.4.210.0070.06718.98
5.4.200.0070.06319.01
5.4.190.0030.07019.16
5.4.180.0000.07319.00
5.4.170.0070.06719.22
5.4.160.0030.07018.89
5.4.150.0000.07319.14
5.4.140.0030.07016.37
5.4.130.0070.06316.50
5.4.120.0000.07016.27
5.4.110.0030.07016.25
5.4.100.0000.07016.50
5.4.90.0030.06716.50
5.4.80.0000.07016.52
5.4.70.0030.06716.41
5.4.60.0070.08316.39
5.4.50.0070.06316.32
5.4.40.0070.06016.34
5.4.30.0030.06716.48
5.4.20.0030.06716.28
5.4.10.0100.06316.33
5.4.00.0030.05015.78
5.3.290.0030.07314.82
5.3.280.0030.06714.63
5.3.270.0000.07314.66
5.3.260.0030.07314.50
5.3.250.0000.07014.59
5.3.240.0100.05714.71
5.3.230.0070.06714.46
5.3.220.0070.06714.71
5.3.210.0070.06314.58
5.3.200.0030.06714.61
5.3.190.0030.07014.61
5.3.180.0000.06714.65
5.3.170.0070.06714.55
5.3.160.0070.06714.59
5.3.150.0070.06314.42
5.3.140.0000.07014.59
5.3.130.0030.07314.57
5.3.120.0030.07314.57
5.3.110.0030.06714.68
5.3.100.0070.06314.17
5.3.90.0000.07014.02
5.3.80.0030.06014.11
5.3.70.0030.06714.17
5.3.60.0030.06714.07
5.3.50.0030.06713.94
5.3.40.0030.06314.04
5.3.30.0000.07013.93
5.3.20.0030.06713.71
5.3.10.0000.06713.56
5.3.00.0100.06313.65

preferences:
29.79 ms | 401 KiB | 5 Q