3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roll($seed, $key, $nonce) { $key = "your client seed"; // excluding the dash and the nonce! $seed = "your server seed"; // 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); ?>

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.4.10.0030.00617.66
8.3.140.0080.00019.14
8.3.130.0000.00816.93
8.3.120.0000.01019.07
8.3.110.0080.00020.94
8.3.100.0090.00924.06
8.3.90.0070.00026.77
8.3.80.0100.00018.54
8.3.70.0120.00916.61
8.3.60.0110.01118.68
8.3.50.0100.00921.99
8.3.40.0120.00318.83
8.3.30.0110.00318.59
8.3.20.0040.00419.16
8.3.10.0060.00323.53
8.3.00.0040.00420.77
8.2.260.0090.00918.84
8.2.250.0000.00917.32
8.2.240.0060.00318.73
8.2.230.0040.00422.58
8.2.220.0090.00037.54
8.2.210.0030.00626.77
8.2.200.0060.00316.50
8.2.190.0070.01116.63
8.2.180.0070.00716.75
8.2.170.0130.00922.96
8.2.160.0080.00619.03
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00720.39
8.2.120.0000.00826.35
8.2.110.0060.00320.94
8.2.100.0120.00017.84
8.2.90.0040.00418.03
8.2.80.0000.00919.21
8.2.70.0080.00017.63
8.2.60.0040.00417.63
8.2.50.0050.00318.10
8.2.40.0000.00822.19
8.2.30.0020.00519.25
8.2.20.0000.00717.78
8.2.10.0030.00518.14
8.2.00.0000.00818.07
8.1.310.0100.00718.16
8.1.300.0090.00016.39
8.1.290.0000.00930.84
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0070.00322.46
8.1.230.0040.00820.96
8.1.220.0050.00317.78
8.1.210.0030.00518.77
8.1.200.0000.00917.23
8.1.190.0030.00717.36
8.1.180.0050.00218.10
8.1.170.0050.00318.58
8.1.160.0000.00719.03
8.1.150.0040.00418.92
8.1.140.0040.00419.60
8.1.130.0030.00520.68
8.1.120.0000.00717.50
8.1.110.0000.00817.50
8.1.100.0050.00317.38
8.1.90.0030.00517.46
8.1.80.0070.00017.43
8.1.70.0000.00917.46
8.1.60.0040.00417.63
8.1.50.0040.00417.41
8.1.40.0060.00317.57
8.1.30.0000.00817.59
8.1.20.0030.00517.68
8.1.10.0040.00417.58
8.1.00.0000.00717.35
8.0.300.0040.00420.04
8.0.290.0080.00016.75
8.0.280.0060.00318.55
8.0.270.0000.00717.29
8.0.260.0080.00018.34
8.0.250.0030.00316.98
8.0.240.0000.00616.85
8.0.230.0000.00716.89
8.0.220.0000.00716.85
8.0.210.0000.00816.89
8.0.200.0030.00316.93
8.0.190.0030.00616.95
8.0.180.0000.00716.99
8.0.170.0000.00716.93
8.0.160.0000.00716.80
8.0.150.0000.00716.88
8.0.140.0000.00716.89
8.0.130.0070.00013.39
8.0.120.0000.00816.80
8.0.110.0020.00516.92
8.0.100.0070.00016.89
8.0.90.0070.00016.73
8.0.80.0000.01516.86
8.0.70.0080.00016.89
8.0.60.0030.00616.86
8.0.50.0000.00816.81
8.0.30.0090.01217.31
8.0.20.0150.00717.40
8.0.10.0070.00016.88
8.0.00.0120.00616.88
7.4.330.0000.00415.08
7.4.320.0030.00616.53
7.4.300.0030.00316.63
7.4.290.0000.00716.52
7.4.280.0030.00516.61
7.4.270.0000.00716.53
7.4.260.0030.00316.41
7.4.250.0040.00416.54
7.4.240.0030.00316.57
7.4.230.0030.00316.61
7.4.220.0110.00716.49
7.4.210.0060.00916.66
7.4.200.0050.00316.69
7.4.160.0060.00916.47
7.4.150.0100.01017.40
7.4.140.0080.00817.86
7.4.130.0050.01516.53
7.4.120.0110.00716.55
7.4.110.0140.00316.68
7.4.100.0060.01216.74
7.4.90.0060.01016.57
7.4.80.0140.00319.39
7.4.70.0080.00916.59
7.4.60.0120.00616.60
7.4.50.0060.00916.40
7.4.40.0120.00916.46
7.4.30.0100.00616.53
7.4.00.0060.00814.85
7.3.330.0020.00213.25
7.3.320.0000.00513.31
7.3.310.0000.00716.30
7.3.300.0030.00316.28
7.3.290.0110.00516.32
7.3.280.0100.00816.29
7.3.270.0110.00717.40
7.3.260.0120.00516.56
7.3.250.0090.00816.41
7.3.240.0120.00616.50
7.3.230.0200.00316.44
7.3.210.0140.00316.66
7.3.200.0140.00316.26
7.3.190.0030.01716.41
7.3.180.0090.01316.56
7.3.170.0100.01316.60
7.3.160.0150.00316.38
7.3.120.0090.00914.83
7.3.110.0070.01115.12
7.3.100.0100.00315.04
7.3.90.0030.01215.07
7.3.80.0000.01014.77
7.3.70.0040.01114.67
7.3.60.0040.00714.81
7.3.50.0090.00914.99
7.3.40.0110.00714.97
7.3.30.0090.00014.97
7.3.20.0040.01216.73
7.3.10.0070.00316.38
7.3.00.0030.01016.82
7.2.330.0060.01116.60
7.2.320.0180.00616.76
7.2.310.0070.01016.82
7.2.300.0080.00816.61
7.2.290.0090.00616.37
7.2.250.0070.01315.02
7.2.240.0040.01115.31
7.2.230.0040.01115.25
7.2.220.0080.00415.28
7.2.210.0060.00614.80
7.2.200.0070.01015.07
7.2.190.0140.00015.18
7.2.180.0060.00915.00
7.2.170.0000.00914.89
7.2.80.0030.01316.74
7.2.60.0070.01017.02
7.2.00.0090.00319.37
7.1.330.0070.00716.08
7.1.320.0030.00915.95
7.1.310.0040.00915.84
7.1.300.0060.00915.83
7.1.290.0060.00915.90
7.1.280.0030.00715.78
7.1.270.0000.01415.77
7.1.260.0090.00315.79
7.1.200.0080.00415.84
7.1.100.0030.00917.98
7.1.70.0080.00016.85
7.1.60.0090.01219.47
7.1.00.0070.07322.51
7.0.200.0030.00616.45
7.0.70.0030.08721.68
7.0.60.0000.09021.82
7.0.50.0100.07322.09
7.0.40.0170.07320.14
7.0.30.0030.08320.10
7.0.20.0100.08020.05
7.0.10.0030.06720.04
7.0.00.0070.07320.18
5.6.280.0070.07021.13
5.6.220.0000.09020.48
5.6.210.0030.08720.51
5.6.200.0070.08721.07
5.6.190.0000.07321.18
5.6.180.0100.08021.01
5.6.170.0000.07721.10
5.6.160.0000.09021.02
5.6.150.0030.04321.05
5.6.140.0030.04020.94
5.6.130.0070.08021.02
5.6.120.0000.09021.00
5.6.110.0000.06021.02
5.6.100.0030.08721.01
5.6.90.0070.04721.06
5.6.80.0000.04020.44
5.6.70.0070.08020.40
5.6.60.0070.07720.55
5.6.50.0130.07720.55
5.6.40.0030.07020.38
5.6.30.0100.07320.53
5.6.20.0100.07720.31
5.6.10.0070.07320.39
5.6.00.0100.07720.42
5.5.360.0030.08020.30
5.5.350.0100.06320.41
5.5.340.0030.08320.84
5.5.330.0130.07720.80
5.5.320.0070.05020.91
5.5.310.0100.05720.91
5.5.300.0000.05720.91
5.5.290.0000.09020.78
5.5.280.0130.08320.87
5.5.270.0100.08020.72
5.5.260.0070.05020.86
5.5.250.0000.06020.61
5.5.240.0030.03720.27
5.5.230.0030.08020.14
5.5.220.0070.08020.29
5.5.210.0070.04020.29
5.5.200.0130.06020.23
5.5.190.0130.07020.15
5.5.180.0000.08720.25
5.5.160.0030.08020.27
5.5.150.0030.08020.20
5.5.140.0070.07720.15
5.5.130.0070.08020.22
5.5.120.0000.08320.12
5.5.110.0070.08020.17
5.5.100.0070.07320.07
5.5.90.0070.03720.11
5.5.80.0130.06320.07
5.5.70.0030.07720.17
5.5.60.0070.07319.96
5.5.50.0100.07320.14
5.5.40.0030.07320.05
5.5.30.0100.06020.10
5.5.20.0070.05720.05
5.5.10.0030.07020.08
5.5.00.0030.07020.12
5.4.450.0030.08319.57
5.4.440.0000.09019.55
5.4.430.0000.08719.37
5.4.420.0070.05719.17
5.4.410.0030.07319.05
5.4.400.0070.03719.13
5.4.390.0070.07718.88
5.4.380.0030.07718.87
5.4.370.0000.08019.13
5.4.360.0030.06319.15
5.4.350.0030.05319.15
5.4.340.0000.08319.18
5.4.320.0070.08019.23
5.4.310.0030.07318.84
5.4.300.0100.06019.05
5.4.290.0070.06719.04
5.4.280.0070.07318.84
5.4.270.0000.04719.16
5.4.260.0070.07718.89
5.4.250.0000.05719.13
5.4.240.0000.07719.04
5.4.230.0000.08318.88
5.4.220.0100.07319.11
5.4.210.0130.07019.16
5.4.200.0030.06019.11
5.4.190.0030.07019.11
5.4.180.0030.05719.01
5.4.170.0100.07019.15
5.4.160.0070.06718.87
5.4.150.0030.07719.07
5.4.140.0000.05016.40
5.4.130.0030.03316.39
5.4.120.0070.03016.41
5.4.110.0000.04016.50
5.4.100.0070.03016.48
5.4.90.0070.03316.50
5.4.80.0000.03716.34
5.4.70.0000.03716.34
5.4.60.0030.03316.41
5.4.50.0030.03316.43
5.4.40.0070.03716.43
5.4.30.0030.07016.31
5.4.20.0070.05316.38
5.4.10.0000.03716.43
5.4.00.0030.03315.72
5.3.290.0070.05314.69
5.3.280.0070.05314.61
5.3.270.0100.07314.67
5.3.260.0000.08014.71
5.3.250.0030.06714.54
5.3.240.0000.03714.61
5.3.230.0000.04714.56
5.3.220.0000.03714.59
5.3.210.0000.04014.65
5.3.200.0000.04314.63
5.3.190.0000.03714.62
5.3.180.0000.03714.55
5.3.170.0000.03714.58
5.3.160.0000.03714.59
5.3.150.0000.03714.67
5.3.140.0030.03314.48
5.3.130.0000.03714.59
5.3.120.0000.04014.63
5.3.110.0000.03014.68
5.3.100.0000.04314.09
5.3.90.0000.03714.01
5.3.80.0030.03014.05
5.3.70.0030.05014.04
5.3.60.0000.04014.06
5.3.50.0000.03313.97
5.3.40.0000.03013.98
5.3.30.0000.03013.85
5.3.20.0030.04013.78
5.3.10.0000.04713.77
5.3.00.0030.05713.54
5.2.170.0000.02311.28
5.2.160.0030.02711.16
5.2.150.0030.03011.13
5.2.140.0000.03011.19
5.2.130.0070.03710.99
5.2.120.0000.02710.92
5.2.110.0000.03011.02
5.2.100.0000.06311.09
5.2.90.0000.03711.09
5.2.80.0000.04711.23
5.2.70.0000.03711.16
5.2.60.0000.03011.16
5.2.50.0030.02711.08
5.2.40.0000.04010.88
5.2.30.0000.03311.04
5.2.20.0000.04011.02
5.2.10.0000.02710.85
5.2.00.0000.03010.82
5.1.60.0000.02010.04
5.1.50.0000.03010.05
5.1.40.0000.02710.10
5.1.30.0030.05010.36
5.1.20.0000.03010.27
5.1.10.0000.02710.15
5.1.00.0000.02710.13
5.0.50.0030.0279.63
5.0.40.0000.0279.63
5.0.30.0000.0379.63
5.0.20.0000.0209.63
5.0.10.0030.0179.63
5.0.00.0000.0509.63
4.4.90.0000.0279.63
4.4.80.0000.0139.63
4.4.70.0000.0179.63
4.4.60.0000.0139.63
4.4.50.0000.0139.63
4.4.40.0000.0239.63
4.4.30.0030.0109.63
4.4.20.0000.0179.63
4.4.10.0030.0139.63
4.4.00.0000.0309.63
4.3.110.0030.0139.63
4.3.100.0000.0279.63
4.3.90.0000.0139.63
4.3.80.0000.0409.63
4.3.70.0000.0209.63
4.3.60.0000.0239.63
4.3.50.0070.0109.63
4.3.40.0070.0409.63
4.3.30.0000.0179.63
4.3.20.0000.0179.63
4.3.10.0030.0139.63
4.3.00.0000.0209.63

preferences:
73.98 ms | 403 KiB | 5 Q