3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roll($seed, $key, $nonce) { $key = "c52e2851529697f47fa4"; // excluding the dash and the nonce! $seed = "aa8efabd3f69a26e3f52dd9b28ecb7df68fbc5948d80b92725f23b1e4c6b3c23"; // bet made with seed pair (excluding current bet) $nonce = 0; $hash = hash_hmac('sha512', $key . '-' . $nonce, $seed); $index = 0; $lucky = hexdec(substr($hash, $index * 5, 5)); while ($lucky >= pow(10, 6)) { $index++; $lucky = hexdec(substr($hash, $index * 5, 5)); if ($index * 5 + 5 > 128) { return '99.99'; break; } } $lucky %= pow(10, 4); $lucky = sprintf('%.2f', bcdiv($lucky, '100', 2)); return $lucky; } echo roll('bla','blah',2); ?> <?php echo hash('sha512', '3d7ff67a23443ccfc42c065ab588700d886b310c805fc850b97c39d112ec9a6e'); ?>

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)
8.3.70.0140.01118.30
8.3.60.0070.00718.43
8.3.50.0030.01221.98
8.3.40.0070.00718.86
8.3.30.0040.01118.89
8.3.20.0080.00019.13
8.3.10.0080.00023.53
8.3.00.0040.00421.01
8.2.190.0110.00416.63
8.2.180.0060.01016.32
8.2.170.0150.00022.96
8.2.160.0100.00319.21
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0040.00420.39
8.2.120.0050.00326.35
8.2.110.0110.00020.89
8.2.100.0090.00319.66
8.2.90.0000.00819.17
8.2.80.0080.00017.97
8.2.70.0000.00817.63
8.2.60.0000.00818.34
8.2.50.0000.00818.10
8.2.40.0040.00420.60
8.2.30.0040.00419.33
8.2.20.0040.00417.81
8.2.10.0050.00218.16
8.2.00.0040.00418.15
8.1.280.0090.00625.92
8.1.270.0070.00023.92
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0000.00921.44
8.1.230.0080.00417.82
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0050.00517.35
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0000.01118.52
8.1.160.0030.00319.02
8.1.150.0040.00418.94
8.1.140.0000.00819.56
8.1.130.0040.00417.66
8.1.120.0070.00017.51
8.1.110.0110.00017.46
8.1.100.0040.00417.47
8.1.90.0040.00417.50
8.1.80.0050.00317.41
8.1.70.0030.00317.53
8.1.60.0070.00717.60
8.1.50.0000.00817.61
8.1.40.0070.00017.52
8.1.30.0040.00417.68
8.1.20.0000.00717.66
8.1.10.0050.00217.57
8.1.00.0000.00817.45
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0040.00418.51
8.0.270.0070.00017.32
8.0.260.0030.00318.34
8.0.250.0000.00716.98
8.0.240.0050.00216.96
8.0.230.0030.00317.04
8.0.220.0040.00416.90
8.0.210.0050.00216.95
8.0.200.0030.00316.94
8.0.190.0000.00716.93
8.0.180.0040.00416.94
8.0.170.0040.00416.93
8.0.160.0070.00016.88
8.0.150.0070.00016.74
8.0.140.0000.00916.94
8.0.130.0080.00013.36
8.0.120.0060.00316.85
8.0.110.0050.00216.82
8.0.100.0070.00016.76
8.0.90.0000.00716.93
8.0.80.0030.01216.83
8.0.70.0000.00716.93
8.0.60.0000.00716.80
8.0.50.0040.00416.91
8.0.30.0100.00817.12
8.0.20.0120.00917.40
8.0.10.0000.00717.04
8.0.00.0140.00416.95
7.4.330.0000.00615.08
7.4.320.0060.00016.54
7.4.300.0060.00316.60
7.4.290.0050.00216.45
7.4.280.0050.00316.64
7.4.270.0030.00316.43
7.4.260.0040.00416.61
7.4.250.0040.00416.51
7.4.240.0030.00316.62
7.4.230.0070.00016.37
7.4.220.0160.00616.63
7.4.210.0000.01416.49
7.4.200.0070.00016.43
7.4.160.0120.00416.68
7.4.150.0110.00717.40
7.4.140.0090.01117.86
7.4.130.0090.00816.59
7.4.120.0090.01016.50
7.4.110.0120.00416.60
7.4.100.0150.00616.44
7.4.90.0170.00016.48
7.4.80.0120.00919.39
7.4.70.0070.01416.52
7.4.60.0110.00716.77
7.4.50.0120.00316.60
7.4.40.0110.00616.48
7.4.30.0060.00916.59
7.4.00.0060.00714.92
7.3.330.0000.00513.33
7.3.320.0050.00013.39
7.3.310.0000.00716.35
7.3.300.0030.00316.32
7.3.290.0090.00616.32
7.3.280.0090.00716.30
7.3.270.0130.00317.40
7.3.260.0080.01416.35
7.3.250.0140.00916.46
7.3.240.0050.01316.37
7.3.230.0080.00816.47
7.3.210.0090.00916.61
7.3.200.0090.00616.69
7.3.190.0070.01016.59
7.3.180.0040.01316.56
7.3.170.0090.00916.68
7.3.160.0080.00816.38
7.3.10.0140.00016.75
7.3.00.0070.00716.79
7.2.330.0040.01216.61
7.2.320.0100.01016.69
7.2.310.0070.01116.45
7.2.300.0070.01516.47
7.2.290.0100.00716.51
7.2.130.0030.00916.79
7.2.120.0070.00716.98
7.2.110.0070.00717.01
7.2.100.0070.00317.03
7.2.90.0130.00316.92
7.2.80.0000.01117.06
7.2.70.0120.00016.80
7.2.60.0100.01016.84
7.2.50.0060.00617.05
7.2.40.0070.00316.70
7.2.30.0000.01116.82
7.2.20.0080.00317.02
7.2.10.0080.00317.08
7.2.00.0020.01018.15
7.1.250.0000.00815.66
7.1.100.0000.01318.40
7.1.70.0000.00716.97
7.1.60.0060.01219.47
7.1.00.0030.07322.21
7.0.200.0030.00516.81
7.0.70.0070.03721.65
7.0.60.0000.04321.73
7.0.50.0000.04321.97
7.0.40.0000.04320.17
7.0.30.0130.04020.18
7.0.20.0030.07020.10
7.0.10.0000.04320.08
7.0.00.0000.06720.06
5.6.280.0030.07321.07
5.6.220.0000.04320.71
5.6.210.0030.04020.74
5.6.200.0030.04021.02
5.6.190.0130.04721.04
5.6.180.0030.08321.02
5.6.170.0070.06021.06
5.6.160.0030.04320.96
5.6.150.0000.04021.02
5.6.140.0000.04320.93
5.6.130.0000.03721.06
5.6.120.0100.03321.11
5.6.110.0130.02321.13
5.6.100.0070.03721.00
5.6.90.0030.03321.03
5.6.80.0030.03720.50
5.6.70.0070.05320.43
5.6.60.0000.04320.49
5.6.50.0030.03720.34
5.6.40.0000.04320.37
5.6.30.0000.04020.50
5.6.20.0070.02720.31
5.6.10.0000.03320.48
5.6.00.0030.05020.45
5.5.360.0070.04020.50
5.5.350.0100.06320.44
5.5.340.0070.04020.89
5.5.330.0070.04020.84
5.5.320.0070.03720.65
5.5.310.0000.04720.80
5.5.300.0000.04320.64
5.5.290.0000.04320.89
5.5.280.0070.03720.84
5.5.270.0030.08320.86
5.5.260.0030.04020.88
5.5.250.0070.05720.75
5.5.240.0070.04720.26
5.5.230.0030.04020.27
5.5.220.0070.05020.18
5.5.210.0070.03320.23
5.5.200.0000.03320.26
5.5.190.0000.05320.18
5.5.180.0000.04020.24
5.5.160.0030.03720.23
5.5.150.0000.04320.21
5.5.140.0070.07320.17
5.5.130.0100.03020.15
5.5.120.0000.04020.20
5.5.110.0000.04320.18
5.5.100.0000.04720.09
5.5.90.0030.06320.16
5.5.80.0070.05719.95
5.5.70.0000.04320.06
5.5.60.0070.03319.96
5.5.50.0000.05720.15
5.5.40.0000.06719.96
5.5.30.0070.07019.93
5.5.20.0000.08719.94
5.5.10.0100.03319.97
5.5.00.0030.07719.95

preferences:
48.1 ms | 401 KiB | 5 Q