3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * Fill in all four below and click the blue 'eval();' button. * ------------------ */ $server_seed = "1e54f598c40ea0ac1a8f94af07113fdd82a9346b1cf764a85c43c33a5d868531"; $public_seed = "1127130323"; $round = "10846325"; /* ------------------ */ if ($server_seed == '' || $public_seed === "" || $round == '') { echo "Fill in details"; return; } $hash = hash_hmac('sha256', $public_seed . "-" . $round, $server_seed); $decimal_hash = '0'; $length = strlen($hash); for ($i = 0; $i < $length; $i++) { $decimal_hash = bcmul($decimal_hash, '16'); // Multiply by base 16 $decimal_hash = bcadd($decimal_hash, hexdec($hash[$i])); // Add the current digit } // Apply modulo to get the roll $roll = bcmod($decimal_hash, '15'); // Use modulo 15 to get the roll if ($roll == 0) $roll_colour = 'bonus'; elseif ($roll >= 1 and $roll <= 7) $roll_colour = 'orange'; elseif ($roll >= 8 and $roll <= 14) $roll_colour = 'black'; echo("Roll: $roll\nColour: $roll_colour");

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.70.0110.01019.59
8.4.60.0150.00819.38
8.4.50.0390.00817.71
8.4.40.0440.00717.59
8.4.30.0360.00817.76
8.4.20.0460.01017.66
8.4.10.0400.00917.73
8.3.210.0050.00216.54
8.3.200.0310.00616.63
8.3.190.0270.00616.51
8.3.180.0140.00516.55
8.3.170.0340.01116.62
8.3.160.0490.00516.43
8.3.150.0220.00716.58
8.3.140.0330.00516.33
8.3.130.0220.00616.68
8.3.120.0210.00616.46
8.3.110.0170.00216.33
8.3.100.0380.01016.47
8.3.90.0400.00916.44
8.3.80.0420.00816.45
8.3.70.0440.01016.20
8.3.60.0390.00916.58
8.3.50.0350.01016.57
8.3.40.0390.01017.75
8.3.30.0280.01117.49
8.3.20.0290.00917.53
8.3.10.0250.01317.53
8.3.00.0320.00817.56
8.2.280.0270.01216.69
8.2.270.0330.00816.60
8.2.260.0350.00516.48
8.2.250.0320.00716.50
8.2.240.0380.01116.59
8.2.230.0340.00716.77
8.2.220.0310.00916.52
8.2.210.0320.00916.48
8.2.200.0330.01016.39
8.2.190.0360.00616.20
8.2.180.0280.01216.32
8.2.170.0350.00817.69
8.2.160.0290.01317.69
8.2.150.0360.00717.78
8.2.140.0280.00817.52
8.2.130.0200.00717.40
8.2.120.0270.00717.65
8.2.110.0150.00617.39
8.2.100.0250.01117.73
8.2.90.0240.00417.58
8.2.80.0360.00517.61
8.2.70.0330.00717.43
8.2.60.0370.00617.39
8.2.50.0330.00817.67
8.2.40.0320.00717.50
8.2.30.0300.00817.66
8.2.20.0300.00917.37
8.2.10.0310.00617.57
8.2.00.0310.00717.72

preferences:
28.5 ms | 403 KiB | 5 Q