3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i; $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.70.0060.00317.08
7.1.60.0090.00317.25
7.1.50.0060.00617.04
7.1.40.0040.00816.40
7.1.30.0070.00716.73
7.1.20.0030.01016.53
7.1.10.0000.00816.76
7.1.00.0040.00816.77
7.0.200.0100.00316.52
7.0.190.0000.01116.59
7.0.180.0000.00916.32
7.0.170.0040.00416.25
7.0.160.0000.00816.14
7.0.150.0030.01816.49
7.0.140.0030.00916.53
7.0.130.0090.00016.58
7.0.120.0030.00516.55
7.0.110.0000.00816.48
7.0.100.0040.00416.34
7.0.90.0000.00916.65
7.0.80.0030.00616.63
7.0.70.0040.00416.65
7.0.60.0040.00416.36
7.0.50.0000.00916.22
7.0.40.0000.01115.79
7.0.30.0000.01015.79
7.0.20.0030.00615.90
7.0.10.0040.00415.90
7.0.00.0030.00615.95
5.6.300.0030.04320.91
5.6.290.0030.04520.84
5.6.280.0030.04420.88
5.6.270.0310.04120.86
5.6.260.0100.03720.79
5.6.250.0030.04620.89
5.6.240.0130.04720.88
5.6.230.0270.04720.88
5.6.220.0030.04220.94
5.6.210.0100.03821.14
5.6.200.0000.05020.88
5.6.190.0000.04720.88
5.6.180.0160.04221.01
5.6.170.0290.03920.83
5.6.160.0060.03820.87
5.6.150.0000.05420.84
5.6.140.0100.03920.92
5.6.130.0070.07020.83
5.6.120.0000.08720.96
5.6.110.0030.04420.83
5.6.100.0170.06320.82
5.6.90.0030.04420.82
5.6.80.0120.04520.18
5.6.70.0100.06220.21
5.6.60.0060.05020.31
5.6.50.0060.04220.17
5.6.40.0160.05120.40
5.6.30.0030.05220.14
5.6.20.0070.03920.38
5.6.10.0030.04520.34
5.6.00.0090.03920.41
5.5.380.0070.08317.57
5.5.370.0000.04417.62
5.5.360.0070.05017.43
5.5.350.0070.04017.40
5.5.340.0070.04018.13
5.5.330.0070.03918.06
5.5.320.0030.04218.09
5.5.310.0100.03517.84
5.5.300.0100.07718.09
5.5.290.0000.05518.03
5.5.280.0070.04118.04
5.5.270.0030.04417.73
5.5.260.0180.06018.02
5.5.250.0030.04817.56
5.5.240.0070.04017.13
5.5.230.0090.04117.48
5.5.220.0060.04017.47
5.5.210.0070.03917.48
5.5.200.0040.04317.45
5.5.190.0070.03917.12
5.5.180.0120.03717.38
5.5.160.0030.04117.43
5.5.150.0100.03617.44
5.5.140.0100.06217.05
5.5.130.0040.04717.18
5.5.120.0030.04417.21
5.5.110.0100.03717.38
5.5.100.0030.04517.34
5.5.90.0070.03817.26
5.5.80.0030.04517.25
5.5.70.0070.04117.41
5.5.60.0030.04416.95
5.5.50.0000.04217.32
5.5.40.0000.05117.26
5.5.30.0040.03717.11
5.5.20.0130.03617.32
5.5.10.0070.04417.38
5.5.00.0330.04016.94
5.4.450.0100.04519.40
5.4.440.0100.03719.46
5.4.430.0030.04819.30
5.4.420.0100.04019.38
5.4.410.0030.04919.08
5.4.400.0060.04218.93
5.4.390.0060.04519.13
5.4.380.0030.04419.14
5.4.370.0060.04219.24
5.4.360.0090.04019.16
5.4.350.0030.04119.08
5.4.340.0030.04819.24
5.4.320.0070.03919.24
5.4.310.0070.03618.98
5.4.300.0060.04819.00
5.4.290.0090.03819.05
5.4.280.0000.04919.05
5.4.270.0030.04118.98
5.4.260.0200.04718.90
5.4.250.0000.04619.20
5.4.240.0070.03719.09
5.4.230.0110.03619.11
5.4.220.0030.04518.98
5.4.210.0070.04719.05
5.4.200.0100.03418.91
5.4.190.0030.03819.19
5.4.180.0070.04019.07
5.4.170.0030.04118.94
5.4.160.0000.04718.96
5.4.150.0060.04519.04
5.4.140.0060.04116.76
5.4.130.0060.03616.63
5.4.120.0000.04116.74
5.4.110.0030.04416.58
5.4.100.0000.04416.67
5.4.90.0000.04016.48
5.4.80.0160.02816.73
5.4.70.0070.03616.67
5.4.60.0030.04016.72
5.4.50.0030.04116.74
5.4.40.0030.03616.77
5.4.30.0000.03816.70
5.4.20.0030.03816.54
5.4.10.0100.03716.71
5.4.00.0000.03716.01
5.3.290.0060.04016.01
5.3.280.0070.03816.01
5.3.270.0040.04616.01
5.3.260.0030.04616.01
5.3.250.0000.04316.01
5.3.240.0070.03316.01
5.3.230.0000.04316.01
5.3.220.0030.08716.01
5.3.210.0000.04316.01
5.3.200.0100.03616.01
5.3.190.0000.04316.01
5.3.180.0000.04416.01
5.3.170.0060.04016.01
5.3.160.0030.03716.01
5.3.150.0100.03416.01
5.3.140.0000.04816.01
5.3.130.0060.04016.01
5.3.120.0030.04416.01
5.3.110.0030.03716.01
5.3.100.0030.04216.01
5.3.90.0000.04616.01
5.3.80.0270.04416.01
5.3.70.0030.05016.01
5.3.60.0070.03516.01
5.3.50.0100.05916.01
5.3.40.0130.03316.01
5.3.30.0030.04116.01
5.3.20.0030.04516.01
5.3.10.0000.03716.01
5.3.00.0030.03716.01

preferences:
37.14 ms | 400 KiB | 5 Q