3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $serverSeed = '7db5eef616a2c672630953954757df8400eeed22a3e0fc1ac6c5555200e122b91e6825b8faf19c723cb09de3da434970a157c21c31b6986e4a75b777361168bc'; $clientSeed = 'FFFFE380'; $nonce = 1; for($nonce =1; $nonce <= 20; $nonce++){ $seed = $serverSeed.'-'.$clientSeed.'-'.$nonce; do { $seed = sha1($seed); $lucky = hexdec(substr($seed,0,8)); } while ($lucky > 4294960000); $luckyNumber = ($lucky % 10000) / 100; if ($luckyNumber < 0) $luckyNumber = -$luckyNumber; echo $nonce.":".$luckyNumber; echo ("\n"); } ?>
based on 0PE2q
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.2.6
1:85.46 2:12.02 3:26.16 4:42.22 5:98.73 6:76.27 7:44.16 8:30.82 9:99.28 10:0.08 11:58.87 12:96.85 13:54.85 14:58.68 15:68.7 16:69.83 17:47.51 18:40.62 19:4.58 20:61.26