3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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; }
based on bvKOe

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.0060.00317.43
7.1.60.0110.01519.50
7.1.50.0100.01017.18
7.1.00.0100.07322.80
7.0.200.0050.00516.87
7.0.60.0000.04320.21
7.0.50.0100.03318.09
7.0.40.0100.08320.56
7.0.30.0470.06020.52
7.0.20.0230.08020.42
7.0.10.0230.08720.38
7.0.00.0000.04320.46
5.6.280.0000.03721.14
5.6.210.0030.06321.03
5.6.200.0100.08318.51
5.6.190.0070.04721.11
5.6.180.0000.06020.90
5.6.170.0370.07320.81
5.6.160.0000.04720.82
5.6.150.0070.03718.54
5.6.140.0130.04018.66
5.6.130.0100.05318.52
5.6.120.0070.07721.34
5.6.110.0070.08021.45
5.6.100.0030.04321.29
5.6.90.0170.06721.34
5.6.80.0300.05720.74
5.6.70.3270.04320.73
5.5.350.0070.08320.85
5.5.340.0100.08018.52
5.5.330.0130.07720.88
5.5.320.0300.04720.88
5.5.310.0330.04320.62
5.5.300.0100.07318.47
5.5.290.0030.06718.36
5.5.280.0000.09021.14
5.5.270.0200.07021.04
5.5.260.0030.04021.03
5.5.250.0070.06020.85
5.5.240.0070.04320.60
5.4.450.0270.05319.84
5.4.440.0270.05319.94
5.4.430.0200.06320.10
5.4.420.0230.05320.07
5.4.410.0170.08319.78
5.4.400.0370.06019.81
5.4.390.0170.05719.76
5.4.380.0100.06019.78
5.4.370.0270.05319.65
5.4.360.0170.06319.68
5.4.350.0200.05319.63
5.4.340.0330.07319.91
5.4.320.0330.05719.54
5.4.310.0200.05319.91
5.4.300.0300.04719.67
5.4.290.0200.06719.73
5.4.280.0200.05719.75
5.4.270.0200.06319.59
5.4.260.0330.04019.50
5.4.250.0070.06719.59
5.4.240.0170.05719.52
5.4.230.0200.05319.61
5.4.220.0300.05719.65
5.4.210.0300.05019.71
5.4.200.0230.06319.74
5.4.190.0270.05019.77
5.4.180.0270.06019.77
5.4.170.0070.07019.90
5.4.160.0270.05019.52
5.4.150.0200.07019.48
5.4.140.0200.05317.00
5.4.130.0200.04716.95
5.4.120.0330.06317.04
5.4.110.0230.05016.90
5.4.100.0270.06317.04
5.4.90.0300.03717.00
5.4.80.0270.05317.14
5.4.70.0230.04716.95
5.4.60.0300.04717.11
5.4.50.0130.06717.20
5.4.40.0270.04716.89
5.4.30.0300.07017.17
5.4.20.0300.05317.09
5.4.10.0170.05716.87
5.4.00.0200.05016.39
5.3.290.0270.06715.05
5.3.280.0270.04715.05
5.3.270.0270.06314.95
5.3.260.0230.05014.96
5.3.250.0270.04714.96
5.3.240.0130.05714.94
5.3.230.0370.04314.81
5.3.220.0200.05314.89
5.3.210.0230.05015.09
5.3.200.0300.04314.73
5.3.190.0300.04314.88