3v4l.org

run code in 300+ PHP versions simultaneously
<?php $range = "INSERT MAX BET NUMBER"; //----------------Insert between the quotes the number of latest bet made within block 499,999 $blockhash = "INSERT HASH OF BLOCK #500.000"; //-----Insert between the quotes the hash of block number 500.000 $hash = hash('sha256', $blockhash); //--------------Create sha256 hash from block hash $hex = substr($hash, 0, 8); //----------------------Take first 8 characters $dec = hexdec($hex); //-----------------------------From hexadecimal to decimal number (max possible number: 4294967295) $random = ($dec * ($range - 1)) / 4294967295; //----Reduce max possible number to $range number $winner = round($random) + 1; //--------------------Transform number to INT and avoid number 0 echo "The winner of 0.01 BTC is the bet number: " . $winner; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Unsupported operand types: string - int in /in/5JBrO:13 Stack trace: #0 {main} thrown in /in/5JBrO on line 13
Process exited with code 255.

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