3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * Fill in all three below and click the blue 'eval();' button. * ------------------ */ $server_seed = ""; $client_seed = ""; $game_id = ""; /* ------------------ */ if ($server_seed == '' || $client_seed === "" || $game_id == '') { echo "Fill in details"; return; } // Create HMAC-SHA256 hash $message = $client_seed . "-" . $game_id; $hmac_hash = hash_hmac('sha256', $message, $server_seed); // Convert hex to decimal using bcmath for large numbers $decimal_value = '0'; $length = strlen($hmac_hash); for ($i = 0; $i < $length; $i++) { $decimal_value = bcmul($decimal_value, '16'); $decimal_value = bcadd($decimal_value, hexdec($hmac_hash[$i])); } // Apply modulo 10^8 $roll = (int) bcmod($decimal_value, '100000000'); // Same "inverse odds" transform as crash_point_from_roll() server-side — // house edge 0.07, floored to the nearest cent, floor of 1.00x. $house_edge = 0.07; $r = $roll / 100000000; $raw = (1 - $house_edge) / (1 - $r); $crash_point = max(1.0, floor($raw * 100) / 100); echo "Roll: " . $roll . "\n"; echo "Crash point: " . number_format($crash_point, 2) . "x"; ?>

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.5.90.0070.00316.74
8.5.80.0340.00716.66
8.5.70.0330.00716.51
8.5.60.0330.01116.46
8.5.50.0400.00616.41
8.5.40.0390.00716.50
8.5.30.0350.00416.24
8.5.20.0200.00816.41
8.5.10.0260.01016.64
8.5.00.0110.00916.53
8.4.240.0160.00819.58
8.4.230.0350.01119.40
8.4.220.0230.01019.48
8.4.210.0260.00819.34
8.4.200.0330.01119.46
8.4.190.0350.01219.25
8.4.180.0290.00819.71
8.4.170.0350.00819.37
8.4.160.0360.00619.55
8.4.150.0340.01719.32
8.4.140.0370.01017.62
8.4.130.0280.00817.56
8.4.120.0370.00417.64
8.4.110.0330.01017.68
8.4.100.0290.00917.44
8.4.90.0380.00917.70
8.4.80.0380.00917.77
8.4.70.0340.01417.82
8.4.60.0370.00717.55
8.4.50.0330.01217.70
8.4.40.0340.01017.48
8.4.30.0350.01117.58
8.4.20.0360.00917.66
8.4.10.0350.01117.63
8.3.330.0120.01118.56
8.3.320.0380.01718.18
8.3.310.0330.00718.44
8.3.300.0320.01018.18
8.3.290.0310.01118.36
8.3.280.0360.00818.37
8.3.270.0420.00716.32
8.3.260.0360.00716.64
8.3.250.0280.00516.54
8.3.240.0280.01016.54
8.3.230.0290.01016.59
8.3.220.0270.01516.67
8.3.210.0370.01116.38
8.3.200.0220.00316.45
8.3.190.0230.00716.35
8.3.180.0140.00616.66
8.3.170.0260.00216.56
8.3.160.0170.00616.57
8.3.150.0250.00616.50
8.3.140.0360.00616.69
8.3.130.0130.00516.69
8.3.120.0170.00316.90
8.3.110.0190.00616.50
8.3.100.0260.00716.40
8.3.90.0160.00516.60
8.3.80.0370.01016.40
8.3.70.0350.00816.36
8.3.60.0330.00916.67
8.3.50.0310.01116.46
8.3.40.0320.00917.90
8.3.30.0300.00717.57
8.3.20.0290.00517.86
8.3.10.0180.00917.80
8.3.00.0260.01017.66
8.2.320.0360.01417.81
8.2.310.0330.01017.96

preferences:
46.43 ms | 765 KiB | 5 Q