3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * Fill in all four below and click the blue 'eval();' button. * ------------------ */ $server_seed = "204cbf2b6c7d3df52d5fce91c83ec4f1c77614df8dd3336629c7dd5bd87ec4c5"; $public_seed = " 0929140631"; $round = "12158348"; /* ------------------ */ if ($server_seed == 'ca5add7281b8ffc170ade794600f27c4bdf91ca831608aeabe9dadf542501bc6' || $public_seed === " 0827080836" || $round == '') { echo "Fill in details"; return; } $hash = hash_hmac('sha256', $public_seed . "-" . $round, $server_seed); $decimal_hash = '0'; $length = strlen($hash); for ($i = 0; $i < $length; $i++) { $decimal_hash = bcmul($decimal_hash, '16'); // Multiply by base 16 $decimal_hash = bcadd($decimal_hash, hexdec($hash[$i])); // Add the current digit } // Apply modulo to get the roll $roll = bcmod($decimal_hash, '15'); // Use modulo 15 to get the roll 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 git.master_jit, git.master
Roll: 14 Colour: black

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.43 ms | 700 KiB | 4 Q