3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * Fill in all five below and click blue 'eval();' button below textarea. * * ------------------ */ $game_seed_hash = ''; #SHA-256 Server SEED $game_seed = ''; #Server SEED $clients_seed = ''; #Client SEED $nonce = ''; #NONCE /* ------------------ */ if ($game_seed_hash == '' || $game_seed == '' || $clients_seed == '' || $nonce == '') exit("Fill in details"); $game_seed_sha256 = hash('sha256', $game_seed); $hash = hash('sha256', $game_seed.'|'.$clients_seed.'|'.$nonce); $num = hexdec(substr($hash, 0, 8)) % 10000 + 1; echo "Hash matches: ".($game_seed_hash == $game_seed_sha256 ? 'Yes': 'No')."\n"; echo "Generated number: $num";

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.20.0100.01017.71
8.4.10.0100.01019.73
8.3.140.0070.01116.53
8.3.130.0080.00016.61
8.3.120.0130.00718.76
8.3.110.0080.00016.75
8.3.100.0030.00624.06
8.3.90.0080.00026.77
8.3.80.0030.00716.75
8.3.70.0040.01116.58
8.3.60.0060.00916.75
8.3.50.0150.00620.25
8.3.40.0080.00818.75
8.3.30.0080.00818.79
8.3.20.0080.00024.18
8.3.10.0000.00824.66
8.3.00.0080.00026.16
8.2.260.0040.00416.57
8.2.250.0040.00418.29
8.2.240.0040.00418.66
8.2.230.0060.00320.94
8.2.220.0000.00937.54
8.2.210.0180.00026.77
8.2.200.0060.00616.50
8.2.190.0100.01016.58
8.2.180.0110.00725.92
8.2.170.0120.00619.01
8.2.160.0100.00322.96
8.2.150.0060.00325.66
8.2.140.0100.00724.66
8.2.130.0080.00026.16
8.2.120.0000.00720.98
8.2.110.0110.00020.94
8.2.100.0000.01217.84
8.2.90.0060.00617.74
8.2.80.0000.00917.97
8.2.70.0000.00817.75
8.2.60.0050.00317.80
8.2.50.0060.00318.10
8.2.40.0060.00318.34
8.2.30.0020.00518.02
8.2.20.0000.00720.48
8.2.10.0000.00717.71
8.2.00.0030.00619.23
8.1.310.0150.00317.92
8.1.300.0030.00618.39
8.1.290.0060.00330.84
8.1.280.0080.00825.92
8.1.270.0050.00223.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0000.00922.00
8.1.230.0110.00022.79
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.13
8.1.190.0040.00417.10
8.1.180.0080.00018.10
8.1.170.0030.00618.76
8.1.160.0000.00818.76
8.1.150.0040.00418.62
8.1.140.0040.00417.49
8.1.130.0030.00317.45
8.1.120.0040.00417.36
8.1.110.0030.00617.37
8.1.100.0000.00717.31
8.1.90.0000.00717.45
8.1.80.0050.00417.37
8.1.70.0000.00717.44
8.1.60.0000.01017.56
8.1.50.0070.00417.55
8.1.40.0000.00717.52
8.1.30.0040.00417.59
8.1.20.0210.00417.58
8.1.10.0160.00817.48
8.1.00.0200.00517.39
8.0.300.0040.00419.95
8.0.290.0070.00016.75
8.0.280.0040.00420.16
8.0.270.0040.00419.79
8.0.260.0000.00716.91
8.0.250.0030.00317.00
8.0.240.0030.00317.03
8.0.230.0000.00717.05
8.0.220.0030.00316.94
8.0.210.0040.00416.87
8.0.200.0000.00716.90
8.0.190.0000.00817.04
8.0.180.0050.00516.84
8.0.170.0000.01016.98
8.0.160.0070.00016.87
8.0.150.0100.01016.82
8.0.140.0060.01316.81
8.0.130.0090.01216.83
8.0.120.0200.00016.94
8.0.110.0160.00316.72
8.0.100.0190.00016.94
8.0.90.0150.00516.97
8.0.80.0120.00716.88
8.0.70.0190.00016.79
8.0.60.0130.00716.85
8.0.50.0140.00216.86
8.0.30.0060.01216.86
8.0.20.0110.00716.96
8.0.10.0160.00516.96
7.4.330.0000.00515.55
7.4.320.0030.00616.51
7.4.300.0030.00316.63
7.4.290.0040.00416.46
7.4.280.0000.01016.42
7.4.270.0140.01116.63
7.4.260.0200.00316.61
7.4.250.0150.00616.46
7.4.240.0110.01116.43
7.4.230.0120.00816.55
7.4.220.0100.01016.57
7.4.210.0110.00816.45
7.4.200.0100.00716.55
7.4.190.0140.00516.46
7.4.180.0150.00316.52
7.4.160.0170.00316.59
7.4.150.0150.00516.35
7.4.140.0180.00416.48
7.4.130.0110.00616.40
7.4.120.0130.00616.40
7.4.110.0150.00416.43
7.4.100.0060.01016.61
7.4.90.0160.00016.43
7.4.80.0120.00516.45
7.4.70.0130.00416.31
7.4.60.0110.00616.35
7.4.50.0140.00216.40
7.4.40.0160.00316.29
7.4.30.0120.00916.41
7.4.20.0070.00716.39
7.4.10.0170.00016.49
7.4.00.0130.00416.34

preferences:
29.05 ms | 403 KiB | 5 Q