3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = "beb83c000e115e9944606f8e1b74b3a7e73ef99bb4896389ae2930b37307d771"; $public_seed = "3329391827"; $round = "6175260"; $hash = unhashed('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 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Call to undefined function unhashed() in /in/ospfs:6 Stack trace: #0 {main} thrown in /in/ospfs on line 6
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Call to undefined function unhashed() in /in/ospfs:6 Stack trace: #0 {main} thrown in /in/ospfs on line 6
Process exited with code 255.

preferences:
158.35 ms | 402 KiB | 153 Q