3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i=0; $i < 100; $i+=1){ $array = generate(); echo "id: $array[0]\nkey: $array[1]\n\n"; } 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.2.110.0220.00516.73
7.2.100.0190.01016.67
7.2.90.0170.01016.85
7.2.80.0160.00816.49
7.2.70.0180.01417.13
7.2.60.0290.00317.00
7.2.50.0240.01016.96
7.2.40.0270.00416.78
7.2.30.0160.01017.07
7.2.20.0110.01516.77
7.2.10.0220.00917.03
7.2.00.0030.01318.29
7.1.230.0160.01015.56
7.1.220.0050.01615.61
7.1.210.0150.01115.75
7.1.200.0180.01115.94
7.1.190.0100.01515.70
7.1.180.0130.01515.81
7.1.170.0190.00915.75
7.1.160.0070.01915.68
7.1.150.0140.00915.63
7.1.140.0130.01315.96
7.1.130.0200.00715.89
7.1.120.0170.01015.55
7.1.110.0210.00715.73
7.1.100.0120.01215.68
7.1.90.0140.01115.92
7.1.80.0250.00315.46
7.1.70.0080.00916.48
7.1.60.0160.00616.48
7.1.50.0090.01516.29
7.1.40.0070.01416.30
7.1.30.0130.01116.10
7.1.20.0120.01416.29
7.1.10.0110.00916.12
7.1.00.0090.01116.31
7.0.310.0140.01015.41
7.0.300.0150.01215.16
7.0.290.0150.01115.50
7.0.280.0060.01715.46
7.0.270.0130.01315.23
7.0.260.0240.00315.28
7.0.250.0140.00715.54
7.0.240.0180.00815.58
7.0.230.0200.00415.46
7.0.220.0170.00415.49
7.0.210.0110.01515.50
7.0.200.0110.00915.96
7.0.190.0090.00715.89
7.0.180.0110.00715.95
7.0.170.0090.01015.82
7.0.160.0090.00915.86
7.0.150.0050.01315.94
7.0.140.0070.01015.84
7.0.130.0070.01516.02
7.0.120.0070.00915.95
7.0.110.0090.00715.78
7.0.100.0050.01215.79
7.0.90.0080.01015.73
7.0.80.0070.00915.91
7.0.70.0110.01315.78
7.0.60.0180.01015.83
7.0.50.0140.01215.88
7.0.40.0180.00414.46
7.0.30.0100.00814.53
7.0.20.0210.01014.50
7.0.10.0180.00914.48
7.0.00.0170.00814.36
5.6.380.0160.01314.23
5.6.370.0150.01114.45
5.6.360.0170.01114.48
5.6.350.0120.01414.75
5.6.340.0160.01514.70
5.6.330.0220.00714.02
5.6.320.0240.00414.29
5.6.310.0240.00714.10
5.6.300.0110.05017.49
5.6.290.0110.02617.54
5.6.280.0110.03017.49
5.6.270.0170.04417.60
5.6.260.0090.04517.70
5.6.250.0080.02617.80
5.6.240.0090.03017.62
5.6.230.0090.02417.74
5.6.220.0190.03617.41
5.6.210.0200.02417.61
5.6.200.0220.02417.68
5.6.190.0200.02717.64
5.6.180.0180.03317.48
5.6.170.0130.03517.55
5.6.160.0230.03917.51
5.6.150.0180.03917.63
5.6.140.0230.02717.48
5.6.130.0120.05117.63
5.6.120.0080.03717.52
5.6.110.0120.02517.84
5.6.100.0110.04317.63
5.6.90.0090.02917.58
5.6.80.0080.03217.17
5.6.70.0120.02717.16
5.6.60.0130.03517.24
5.6.50.0140.02317.23
5.6.40.0130.02617.35
5.6.30.0110.02817.12
5.6.20.0110.02617.00
5.6.10.0160.02517.21
5.6.00.0190.02717.36
5.5.380.0170.02714.44
5.5.370.0060.03214.33
5.5.360.0100.02814.54
5.5.350.0140.03514.38
5.5.340.0100.03714.46
5.5.330.0090.03414.57
5.5.320.0100.03914.63
5.5.310.0120.02314.55
5.5.300.0100.03014.70
5.5.290.0060.03014.67
5.5.280.0130.02314.61
5.5.270.0120.05014.73
5.5.260.0080.03014.69
5.5.250.0070.03114.53
5.5.240.0070.02314.19
5.5.230.0130.02414.03
5.5.220.0050.02914.27
5.5.210.0070.02714.21
5.5.200.0100.02514.38
5.5.190.0130.02214.25
5.5.180.0070.02514.22
5.5.170.0170.00714.46
5.5.160.0130.02314.41
5.5.150.0080.02614.28
5.5.140.0130.02014.24
5.5.130.0140.02514.32
5.5.120.0070.03014.23
5.5.110.0140.02414.34
5.5.100.0140.02314.19
5.5.90.0160.02614.18
5.5.80.0160.02014.25
5.5.70.0090.02414.25
5.5.60.0280.01814.17
5.5.50.0100.02414.34
5.5.40.0070.02714.32
5.5.30.0090.02514.38
5.5.20.0100.04314.06
5.5.10.0130.01914.23
5.5.00.0040.02614.01
5.4.450.0040.02715.32
5.4.440.0100.02915.06
5.4.430.0110.02215.26
5.4.420.0110.02115.11
5.4.410.0040.02915.09
5.4.400.0150.02115.05
5.4.390.0130.01815.06
5.4.380.0150.01915.21
5.4.370.0070.03415.05
5.4.360.0080.02815.04
5.4.350.0150.02114.92
5.4.340.0100.02715.06
5.4.330.0150.00611.04
5.4.320.0060.03215.09
5.4.310.0130.02815.05
5.4.300.0140.02015.09
5.4.290.0130.02315.05
5.4.280.0130.02515.03
5.4.270.0170.03015.25
5.4.260.0130.02515.19
5.4.250.0090.02614.95
5.4.240.0130.02615.01
5.4.230.0150.02115.04
5.4.220.0090.02915.11
5.4.210.0160.01914.98
5.4.200.0070.02415.08
5.4.190.0080.02915.02
5.4.180.0110.02515.08
5.4.170.0130.01914.86
5.4.160.0100.02214.88
5.4.150.0080.02714.92
5.4.140.0090.02813.87
5.4.130.0070.03113.80
5.4.120.0070.03713.83
5.4.110.0030.02713.66
5.4.100.0090.02913.82
5.4.90.0080.02013.73
5.4.80.0000.03413.80
5.4.70.0050.02613.87
5.4.60.0090.02713.81
5.4.50.0090.02013.76
5.4.40.0020.02813.77
5.4.30.0090.01913.66
5.4.20.0100.01713.71
5.4.10.0080.02213.82
5.4.00.0070.02213.54
5.3.290.0100.02813.17
5.3.280.0110.02213.09
5.3.270.0090.03213.14
5.3.260.0050.03713.15
5.3.250.0090.02713.14
5.3.240.0080.02313.09
5.3.230.0050.02612.99
5.3.220.0110.02313.04
5.3.210.0080.02512.98
5.3.200.0050.02612.98
5.3.190.0060.02613.07
5.3.180.0030.02713.15
5.3.170.0070.02413.12
5.3.160.0090.02313.13
5.3.150.0060.02713.07
5.3.140.0080.02413.06
5.3.130.0070.02513.07
5.3.120.0050.03113.12
5.3.110.0120.02113.09
5.3.100.0040.02413.16
5.3.90.0120.02312.98
5.3.80.0050.02712.98
5.3.70.0080.02713.06
5.3.60.0050.02613.11
5.3.50.0070.02413.06
5.3.40.0040.02513.05
5.3.30.0050.02313.15
5.3.20.0130.02513.08
5.3.10.0040.02812.98
5.3.00.0050.02012.98

preferences:
46.84 ms | 401 KiB | 5 Q