3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roll($seed, $key, $nonce) { $key = "c52e2851529697f47fa4"; // excluding the dash and the nonce! $seed = "aa8efabd3f69a26e3f52dd9b28ecb7df68fbc5948d80b92725f23b1e4c6b3c23"; // bet made with seed pair (excluding current bet) $nonce = 0; $hash = hash_hmac('sha512', $key . '-' . $nonce, $seed); $index = 0; $lucky = hexdec(substr($hash, $index * 5, 5)); while ($lucky >= pow(10, 6)) { $index++; $lucky = hexdec(substr($hash, $index * 5, 5)); if ($index * 5 + 5 > 128) { return '99.99'; break; } } $lucky %= pow(10, 4); $lucky = sprintf('%.2f', bcdiv($lucky, '100', 2)); return $lucky; } echo roll('bla','blah',2); ?> <?php echo hash('sha512', '3d7ff67a23443ccfc42c065ab588700d886b310c805fc850b97c39d112ec9a6e'); ?>
Output for git.master, git.master_jit, rfc.property-hooks
89.82 038c9c1778ec1db868850d7ae3dfc962f02fe6cd6d815cabf49d1e3bad807e695f3dbbfce6c045fa1b665f62c69862e6673549f131aacc2ca66dfb247ba5a272

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:
30.16 ms | 401 KiB | 8 Q