3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = "1697cc68ec98b327f6f945e6153d9ebd02f675e88f09998fd6149467e334dcad"; $public_seed = "2803202010"; $round = "9310117"; $hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $round); $roll = hexdec(substr($hash, 0, 8)) % 15; if ($roll == 0) $roll_colour = 'bonus'; elseif ($roll >= 1 and $roll <= 7) $roll_colour = 'orange'; elseif ($roll >= 8 and $roll <= 14) $roll_colour = 'black'; echo("Roll: $roll\nColour: $roll_colour");
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.16, 8.3.0 - 8.3.3
Roll: 1 Colour: orange

preferences:
60.79 ms | 402 KiB | 54 Q