3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = "96f3e04d221ca1b2048cc3b3b844e479f2bd9c80a870628072ee98fd1aa83cd0"; // make sure to use non-hashed server seed $public_seed = "20charlongstringxxxxx"; $battle_id = "546"; $tie_breaker_player_count = 2;// how many players have opened the same amount $hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $battle_id . "case-battle-tie-braker"); $winning_player = hexdec(substr($hash, 0, 15)) % $tie_breaker_player_count + 1; // $winning_player represents which player won out of those that opened the same amount. // if player 1 and 3 open the same and we have to determine which one from these wins, if $winning_player = 1, player 1 wins, if $winning_player = 2, player 3 wins echo("Winning ticket: $winning_player");

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.10.0110.00916.80
8.5.00.0140.00920.05
8.4.160.0100.01223.63
8.4.150.0010.00114.05
8.4.140.0130.00817.70
8.4.130.0080.01118.77
8.4.120.0050.00324.26
8.4.110.0110.01019.75
8.4.100.0100.01018.60
8.4.90.0100.01020.44
8.4.80.0070.00219.74
8.4.70.0100.00917.95
8.4.60.0070.01618.66
8.4.50.0110.01018.57
8.4.40.0090.01218.71
8.4.30.0130.00718.91
8.4.20.0160.00320.34
8.4.10.0130.00619.56
8.3.280.0120.00818.39
8.3.270.0140.00716.70
8.3.260.0120.00816.30
8.3.250.0150.00518.71
8.3.240.0100.00917.23
8.3.230.0120.00716.48
8.3.220.0050.00318.81
8.3.210.0100.00916.46
8.3.200.0040.00416.68
8.3.190.0090.01217.01
8.3.180.0090.01017.38
8.3.170.0100.01020.61
8.3.160.0140.00317.29
8.3.150.0130.00716.99
8.3.140.0080.00020.82
8.3.130.0030.00518.35
8.3.120.0000.00820.86
8.3.110.0070.00718.40
8.3.100.0090.00616.50
8.3.90.0070.00718.34
8.3.80.0090.00018.43
8.3.70.0180.00418.30
8.3.60.0270.01125.92
8.3.50.0090.00625.92
8.3.40.0070.01025.92
8.2.290.0100.00920.20
8.2.280.0110.00718.63
8.2.270.0060.00318.80
8.2.260.0040.01118.30
8.2.250.0040.00416.62
8.2.240.0030.00619.04
8.2.230.0060.00320.94
8.2.220.0040.00424.06
8.2.210.0090.00926.77
8.2.200.0090.00018.41
8.2.190.0150.00416.58
8.2.180.0090.00625.92
8.2.170.0150.00625.92
8.1.330.0060.01321.51
8.1.320.0060.01218.19
8.1.310.0090.00918.56
8.1.300.0050.00519.63
8.1.290.0100.00018.88
8.1.280.0100.01025.92

preferences:
82.09 ms | 403 KiB | 5 Q