3v4l.org

run code in 300+ PHP versions simultaneously
<?php $server_seed = ""; $lotto = "1016171938"; $round_id = "11897"; $hash = hash("sha256",$server_seed."-".$lotto."-".$round_id); $roll = hexdec(substr($hash,0,8)) % 15; // Print værdien af $hash print("\$hash = $hash</br>"); // Prifdec(856672a7) = ".(String)hexdec(substr($hash,0,8))."</br>"); // Print værdien af 856672a7 % 15 print("2238083751 % 15 = ".(2238083751 % 15)."</br>"); // Print værdien af roll print("\$roll = $roll"); ?>
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 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.6
$hash = 810edb496719a898b12900c99349f2056a2023e29a78d667f9c32945a4a7aa03</br>2238083751 % 15 = 6</br>$roll = 0

preferences:
268.39 ms | 404 KiB | 330 Q