3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = generate(); echo $array[0]; echo "<br />"; echo $array[1]; echo "<br />"; echo $array[2]; echo "<br />"; echo $array[3]; echo "<br />"; echo $array[4]; // FUNCTION function generate() { $digilist = "0123456789ABCDEFGHJKLMNPQRTUVWXY"; $ip = gethostbyname('keystone.mwbsys.com'); $long = ip2long($ip); $ipenc = md5($long); //now we generate a new random ID number using the substrings of the digitList string above $id = NULL; $id .= substr($digilist, rand(1, 4), 1); //random number ( adjust where 1,4 is lower boundary or 5,9 is higher boundary) $id .= substr($digilist, rand(10, 20), 1); //then a letter $id .= substr($digilist, rand(21, 31), 1); //another letter $id .= substr($digilist, rand(5, 9), 1); //a number ( adjust where 5,9 is higher boundary or 1,4 is lower boundary) $id .= substr($long, rand(1, 9), 1); //and finally another number ( you can adjust this to high or low) // note in $id if start with high-low-high-low or vice versa combination //ok so now we need to generate an MD5 hash of our ID $st = md5('Licensed'); $duration = md5('Lifetime'); $hash = md5($id); //cycle through the hash 16 (length of key) times (in steps of 2 because each hex bytes is 2 digits long) $i = 0; $key = ""; for ($i; $i < 32; $i+=2) { //here we convert the next hex value to an integer and perform a bitwise AND operation against '31' //31 is the highest substring value in our digit list. $nextdigit = hexdec(substr($hash, $i, 2)) & 31; //if 'i' is divisable by 8 (every 4 cycles) then we want to add "-" if ((($i % 8) == 0) && ($i > 0)) { $key .= "-".substr($digilist, $nextdigit,1); } else { $key .= substr($digilist, $nextdigit, 1); } } $array = array($id, $key, $st, $duration, $long); //return 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.4.10.0070.01315.03
7.4.00.0090.00914.93
7.3.130.0060.01214.82
7.3.120.0060.01215.24
7.3.110.0090.00614.82
7.3.100.0040.01115.19
7.3.90.0120.00315.24
7.3.80.0070.00715.15
7.3.70.0070.01415.17
7.3.60.0150.00315.02
7.3.50.0070.00715.04
7.3.40.0040.01114.71
7.3.30.0030.00915.12
7.3.20.0070.00316.78
7.3.10.0100.00616.90
7.3.00.0060.00616.78
7.2.260.0060.00615.35
7.2.250.0030.01615.54
7.2.240.0120.00315.46
7.2.230.0070.00715.39
7.2.220.0030.01215.27
7.2.210.0060.00915.10
7.2.200.0070.01015.37
7.2.190.0120.00915.25
7.2.180.0080.00815.23
7.2.170.0060.01015.33
7.2.160.0070.00715.08
7.2.150.0000.01417.21
7.2.140.0060.00317.07
7.2.130.0030.01017.17
7.2.120.0070.00717.13
7.2.110.0110.00017.25
7.2.100.0030.01316.96
7.2.90.0070.00717.40
7.2.80.0060.00917.23
7.2.70.0120.00316.96
7.2.60.0030.01017.18
7.2.50.0130.00717.21
7.2.40.0070.01317.07
7.2.30.0000.01617.08
7.2.20.0060.00917.28
7.2.10.0130.00317.04
7.2.00.0160.00317.24
7.1.330.0110.00415.96
7.1.320.0060.00916.02
7.1.310.0030.01015.91
7.1.300.0060.00315.85
7.1.290.0000.01516.18
7.1.280.0060.00615.98
7.1.270.0000.01415.97
7.1.260.0070.01016.04
7.1.250.0030.01016.14
7.1.240.0040.00916.05
7.1.230.0040.01116.07
7.1.220.0030.01216.00
7.1.210.0070.00715.97
7.1.200.0090.00616.11
7.1.190.0090.00616.02
7.1.180.0060.00916.02
7.1.170.0000.01616.02
7.1.160.0040.00715.98
7.1.150.0040.01116.18
7.1.140.0030.00916.12
7.1.130.0080.00315.90
7.1.120.0000.01716.15
7.1.110.0090.00616.22
7.1.100.0070.01016.18
7.1.90.0090.00015.95
7.1.80.0040.01415.63
7.1.70.0050.00516.69
7.1.60.0090.01217.72
7.1.50.0100.00816.47
7.1.40.0070.00715.64
7.1.30.0100.00316.08
7.1.20.0070.00716.00
7.1.10.0090.00616.06
7.1.00.0070.04219.27
7.0.330.0060.00915.82
7.0.320.0000.00915.62
7.0.310.0000.01715.37
7.0.300.0100.01015.63
7.0.290.0110.00315.55
7.0.280.0030.00615.58
7.0.270.0000.00915.57
7.0.260.0000.01315.51
7.0.250.0090.00615.54
7.0.240.0080.00415.63
7.0.230.0090.00315.63
7.0.220.0070.00715.63
7.0.210.0080.00415.45
7.0.200.0060.00516.12
7.0.190.0000.01115.56
7.0.180.0070.00715.43
7.0.170.0040.00815.69
7.0.160.0000.01415.53
7.0.150.0070.01015.43
7.0.140.0090.00315.46
7.0.130.0070.00715.64
7.0.120.0040.00815.55
7.0.110.0090.00615.61
7.0.100.0060.01215.48
7.0.90.0090.00615.62
7.0.80.0000.01615.57
7.0.70.0090.00915.57
7.0.60.0030.02517.81
7.0.50.0080.01816.93
7.0.40.0100.04517.09
7.0.30.0250.03717.15
7.0.20.0130.04517.06
7.0.10.0130.04716.97
7.0.00.0020.02617.01
5.6.400.0140.00014.61
5.6.390.0040.01114.19
5.6.380.0060.00614.53
5.6.370.0070.01014.63
5.6.360.0030.01314.57
5.6.350.0090.00614.43
5.6.340.0100.00714.61
5.6.330.0080.00814.90
5.6.320.0100.00314.91
5.6.310.0000.01414.81
5.6.300.0080.00514.39
5.6.290.0090.00314.59
5.6.280.0050.02217.84
5.6.270.0100.00314.47
5.6.260.0030.01014.82
5.6.250.0000.01614.55
5.6.240.0080.00814.54
5.6.230.0100.00014.61
5.6.220.0070.01014.58
5.6.210.0070.03517.87
5.6.200.0090.04716.60
5.6.190.0050.03017.91
5.6.180.0040.03417.64
5.6.170.0200.04117.69
5.6.160.0030.02817.84
5.6.150.0090.02216.56
5.6.140.0120.02316.61
5.6.130.0090.02816.59
5.6.120.0090.04117.90
5.6.110.0060.04518.02
5.6.100.0050.02617.94
5.6.90.0100.04017.95
5.6.80.0150.03617.68
5.6.70.1630.02817.63
5.6.60.0000.01714.82
5.6.50.0070.01014.39
5.6.40.0040.00714.92
5.6.30.0070.00314.34
5.6.20.0030.01014.51
5.6.10.0130.00314.56
5.6.00.0070.00714.63
5.5.380.0070.00714.26
5.5.370.0040.00814.74
5.5.360.0030.00914.84
5.5.350.0070.04517.66
5.5.340.0050.04816.46
5.5.330.0080.04417.70
5.5.320.0150.02917.88
5.5.310.0180.02717.60
5.5.300.0080.03816.67
5.5.290.0070.03516.47
5.5.280.0020.04717.77
5.5.270.0120.04217.59
5.5.260.0070.02217.72
5.5.250.0050.03517.73
5.5.240.0060.02617.45
5.5.230.0070.00314.51
5.5.220.0090.00614.38
5.5.210.0120.00614.37
5.5.200.0070.01014.60
5.5.190.0000.01714.56
5.5.180.0060.00914.61
5.5.170.0060.01014.65
5.5.160.0070.00714.62
5.5.150.0030.00914.50
5.5.140.0040.01114.78
5.5.130.0030.01214.26
5.5.120.0060.00914.49
5.5.110.0080.00814.16
5.5.100.0100.00614.52
5.5.90.0130.00314.45
5.5.80.0090.00614.59
5.5.70.0040.01214.51
5.5.60.0070.01014.35
5.5.50.0040.01114.30
5.5.40.0000.01514.43
5.5.30.0090.00614.13
5.5.20.0030.01514.44
5.5.10.0040.01514.08
5.5.00.0080.00414.24
5.4.450.0150.03115.83
5.4.440.0160.03015.88
5.4.430.0140.03415.96
5.4.420.0140.03015.95
5.4.410.0080.04515.80
5.4.400.0200.03315.82
5.4.390.0120.03015.79
5.4.380.0070.03215.80
5.4.370.0180.02815.74
5.4.360.0110.03515.75
5.4.350.0140.02915.72
5.4.340.0190.04015.87
5.4.330.0030.00911.82
5.4.320.0200.03115.68
5.4.310.0140.02815.87
5.4.300.0210.02315.75
5.4.290.0130.03615.78
5.4.280.0130.03115.79
5.4.270.0140.03315.71
5.4.260.0180.02515.66
5.4.250.0060.03815.71
5.4.240.0100.03215.67
5.4.230.0130.03015.72
5.4.220.0160.03115.74
5.4.210.0190.02915.77
5.4.200.0120.03815.78
5.4.190.0130.02915.79
5.4.180.0150.03515.80
5.4.170.0030.04315.86
5.4.160.0130.02915.67
5.4.150.0120.03815.65
5.4.140.0120.02914.41
5.4.130.0130.02614.38
5.4.120.0180.03714.43
5.4.110.0170.02614.36
5.4.100.0150.03514.43
5.4.90.0170.02014.41
5.4.80.0130.03214.48
5.4.70.0130.02514.39
5.4.60.0170.02514.46
5.4.50.0110.03514.51
5.4.40.0190.02314.36
5.4.30.0200.03714.50
5.4.20.0180.02714.46
5.4.10.0140.02814.35
5.4.00.0120.02914.11

preferences:
43.52 ms | 403 KiB | 5 Q