3v4l.org

run code in 500+ PHP versions simultaneously
<?php $server_seed = '83cd8d18b416bbdd22fa25135608b197'; $client_seeds = 'rnNOy5IWg1TEZfSC0U0CQNGAUFnB5C5Fc3e5a7e0cd2411dc5da8e3e716cc10300c791ffce0742d6c2243b253363f9591KGmiyM8wxtsiGTXt'; $targets = [ 1 => 71459, 2 => 68973, 3 => 92006, 4 => 27155 ]; echo "--- HELLCASE 'SWAPPED' V2 AUDIT ---\n"; foreach ($targets as $nonce => $target_roll) { // VARIATION C: We use the Client Seeds as the KEY and the Server Seed + Nonce as the MESSAGE $message = $server_seed . ':' . $nonce; $hash = hash_hmac('sha256', $message, $client_seeds); $hex_8 = substr($hash, 0, 8); $decimal = hexdec($hex_8); $roll_calculated = ($decimal % 1000000) + 1; echo "Nonce [$nonce]: Calculated: $roll_calculated | Expected: $target_roll -> "; echo ($roll_calculated == $target_roll ? "✅ MATCH!\n" : "❌ FAIL\n"); } ?> <?php $server_seed = '83cd8d18b416bbdd22fa25135608b197'; $client_seeds = 'rnNOy5IWg1TEZfSC0U0CQNGAUFnB5C5Fc3e5a7e0cd2411dc5da8e3e716cc10300c791ffce0742d6c2243b253363f9591KGmiyM8wxtsiGTXt'; $targets = [ 1 => 71459, 2 => 68973, 3 => 92006, 4 => 27155 ]; echo "--- HELLCASE 'SWAPPED' V2 AUDIT ---\n"; foreach ($targets as $nonce => $target_roll) { // VARIATION C: We use the Client Seeds as the KEY and the Server Seed + Nonce as the MESSAGE $message = $server_seed . ':' . $nonce; $hash = hash_hmac('sha256', $message, $client_seeds); $hex_8 = substr($hash, 0, 8); $decimal = hexdec($hex_8); $roll_calculated = ($decimal % 1000000) + 1; echo "Nonce [$nonce]: Calculated: $roll_calculated | Expected: $target_roll -> "; echo ($roll_calculated == $target_roll ? "✅ MATCH!\n" : "❌ FAIL\n"); } ?>

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.30.0330.00816.66
8.5.20.0320.00916.70
8.5.10.0330.00416.75
8.5.00.0340.01116.49
8.4.180.0340.00819.50
8.4.170.0350.00819.66
8.4.160.0300.01119.61
8.4.150.0360.00819.70
8.4.140.0350.01217.80
8.4.130.0200.00617.68
8.4.120.0360.00817.86
8.4.110.0310.01217.81
8.4.100.0290.00817.89
8.4.90.0410.00517.90
8.4.80.0320.01417.86
8.4.70.0370.00917.55
8.4.60.0390.00717.91
8.4.50.0440.00417.76
8.4.40.0330.00817.75
8.4.30.0410.00617.68
8.4.20.0400.00717.49
8.4.10.0370.01017.79
8.3.300.0390.00918.44
8.3.290.0410.00818.09
8.3.280.0340.00718.42
8.3.270.0310.00616.90
8.3.260.0360.00716.67
8.3.250.0330.00716.75
8.3.240.0350.00916.68
8.3.230.0350.01016.76
8.3.220.0330.01116.76
8.3.210.0390.01116.63
8.3.200.0330.01116.61
8.3.190.0370.00816.80
8.3.180.0330.01016.75
8.3.170.0390.00916.55
8.3.160.0370.00916.78
8.3.150.0390.00716.70
8.3.140.0300.01016.66
8.3.130.0270.01416.69
8.3.120.0300.01116.59
8.3.110.0380.00416.64
8.3.100.0420.00416.71
8.3.90.0350.00916.88
8.3.80.0330.00716.86
8.3.70.0380.00716.91
8.3.60.0370.00916.36
8.3.50.0350.01416.55
8.3.40.0390.00517.72
8.3.30.0260.00917.91
8.3.20.0300.00817.64
8.3.10.0290.00617.98
8.3.00.0230.01217.68

preferences:
53.36 ms | 731 KiB | 5 Q