3v4l.org

run code in 300+ PHP versions simultaneously
<?php $game_id = 2820; $client_seed = "gJyxdPdhqv"; $server_seed = "5a5e6a3494cf9572b6dc5dd6aee4263b6eec8b8f331e29c426d03f9ab6ade17f"; $idClientSeed = $client_seed . "-" . $game_id; $hex = hash_hmac("sha512", $idClientSeed, $server_seed); $index = 0; $lucky = hexdec(substr($hex, $index * 5, (($index * 5) - $index * 5 + 5))); while ($lucky >= 1e6) { $index += 1; $lucky = hexdec(substr($hex, $index * 5, (($index * 5) - $index * 5 + 5))); if ($index * 5 + 5 > 129) { $lucky = 9999; break; } } $number = ($lucky % 1e4) * 1e-2; echo "Roll: " . $number;

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.3.60.0290.00721.34
8.3.50.0090.01221.21
8.3.40.0190.01222.47
8.3.30.0170.00822.06
8.3.20.0130.00924.76
8.3.10.0140.00524.41
8.3.00.0130.00724.69
8.2.180.0220.00725.92
8.2.170.0190.00820.69
8.2.160.0140.00922.96
8.2.150.0190.00724.63
8.2.140.0100.00823.92
8.2.130.0110.00724.92
8.2.120.0140.00624.51
8.2.110.0120.00623.96
8.2.100.0120.00824.09
8.2.90.0140.00624.00
8.2.80.0130.00724.10
8.2.70.0100.00564.31
8.2.60.0120.00643.34
8.2.50.0140.00642.38
8.2.40.0110.00638.42
8.2.30.0120.00640.42
8.2.20.0110.00539.54
8.2.10.0120.00639.16
8.2.00.0120.00538.01
8.1.280.0200.00925.92
8.1.270.0120.00624.22
8.1.260.0120.00525.31
8.1.250.0090.00625.30
8.1.240.0120.00524.46
8.1.230.0120.00724.16
8.1.220.0120.00623.53
8.1.210.0120.00723.97
8.1.200.0120.00548.95
8.1.190.0130.00544.53
8.1.180.0130.00542.28
8.1.170.0110.00541.30
8.1.160.0130.00540.36
8.1.150.0130.00539.91
8.1.140.0130.00639.48
8.1.130.0120.00637.95
8.1.120.0120.00637.28
8.1.110.0120.00636.60
8.1.100.0130.00535.40
8.1.90.0120.00533.41
8.1.80.0130.00533.43
8.1.70.0120.00632.75
8.1.60.0120.00632.80
8.1.50.0120.00532.78
8.1.40.0110.00532.00
8.1.30.0120.00530.28
8.1.20.0130.00531.55
8.1.10.0130.00531.48
8.1.00.0120.00531.45
8.0.300.0120.00423.94
8.0.290.0150.00545.81
8.0.280.0150.00540.30
8.0.270.0110.00539.38
8.0.260.0140.00537.76
8.0.250.0110.00537.13
8.0.240.0140.00536.40
8.0.230.0130.00435.19
8.0.220.0120.00533.13
8.0.210.0120.00533.13
8.0.200.0120.00532.50
8.0.190.0130.00532.49
8.0.180.0120.00532.50
8.0.170.0130.00531.91
8.0.160.0110.00531.17
8.0.150.0130.00531.14
8.0.140.0130.00531.14
8.0.130.0120.00530.90
8.0.120.0120.00630.74
8.0.110.0110.00530.77
8.0.100.0120.00530.58
8.0.90.0130.00530.41
8.0.80.0110.00530.12
8.0.70.0110.00530.42
8.0.60.0130.00530.41
8.0.50.0130.00530.41
8.0.30.0100.00627.57
8.0.20.0110.00627.51
8.0.10.0130.00627.63
8.0.00.0110.00626.78
7.4.330.0110.00436.68
7.4.320.0140.00536.31
7.4.300.0130.00632.34
7.4.290.0150.00532.35
7.4.280.0130.00531.17
7.4.270.0140.00530.98
7.4.260.0160.00430.77
7.4.250.0150.00530.59
7.4.240.0140.00530.61
7.4.230.0140.00530.41
7.4.220.0130.00430.08
7.4.210.0130.00529.78
7.4.200.0130.00430.24
7.4.190.0130.00530.26
7.4.180.0130.00630.27
7.4.160.0130.00527.66
7.4.150.0130.00627.41
7.4.140.0130.00627.18
7.4.130.0130.00626.28
7.4.120.0130.00625.74
7.4.110.0130.00625.32
7.4.100.0130.00625.34
7.4.90.0120.00725.30
7.4.80.0130.00625.30
7.4.70.0120.00625.30
7.4.60.0120.00625.32
7.4.50.0130.00625.29
7.4.40.0130.00625.28
7.4.30.0130.00625.30
7.4.20.0120.00725.31
7.4.10.0130.00625.30
7.4.00.0120.00625.32
7.3.330.0140.00530.70
7.3.320.0140.00530.44
7.3.310.0140.00530.49
7.3.300.0140.00530.32
7.3.290.0140.00530.16
7.3.280.0140.00529.23
7.3.270.0140.00527.30
7.3.260.0130.00627.12
7.3.250.0140.00526.22
7.3.240.0130.00625.67
7.3.230.0130.00625.24
7.3.220.0140.00625.22
7.3.210.0130.00625.21
7.3.200.0130.00625.22
7.3.190.0140.00625.21
7.3.180.0140.00625.23
7.3.170.0130.00625.25
7.3.160.0130.00625.22
7.3.150.0140.00525.20
7.3.140.0130.00625.20
7.3.130.0130.00725.22
7.3.120.0130.00625.22
7.3.110.0130.00625.20
7.3.100.0130.00625.17
7.3.90.0120.00625.30
7.3.80.0130.00625.19
7.3.70.0130.00625.26
7.3.60.0140.00525.28
7.3.50.0130.00625.30
7.3.40.0140.00525.28
7.3.30.0120.00725.29
7.3.20.0140.00725.77
7.3.10.0140.00725.77
7.3.00.0150.00625.77
7.2.340.0140.00725.37
7.2.330.0150.00725.35
7.2.320.0150.00625.35
7.2.310.0150.00725.36
7.2.300.0140.00725.36
7.2.290.0140.00725.33
7.2.280.0140.00725.36
7.2.270.0140.00725.36
7.2.260.0140.00625.36
7.2.250.0140.00725.34
7.2.240.0150.00725.35
7.2.230.0140.00725.36
7.2.220.0140.00725.34
7.2.210.0150.00625.35
7.2.200.0150.00725.42
7.2.190.0150.00625.39
7.2.180.0150.00625.38
7.2.170.0150.00625.40
7.2.160.0140.00725.42
7.2.150.0160.00725.94
7.2.140.0150.00625.95
7.2.130.0150.00726.01
7.2.120.0160.00625.96
7.2.110.0170.00625.98
7.2.100.0150.00725.99
7.2.90.0160.00625.95
7.2.80.0160.00725.96
7.2.70.0160.00725.95
7.2.60.0170.00625.94
7.2.50.0150.00725.95
7.2.40.0150.00725.98
7.2.30.0150.00725.97
7.2.20.0150.00725.98
7.2.10.0160.00725.99
7.2.00.0150.00725.97

preferences:
46.35 ms | 401 KiB | 5 Q