3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 輸入偏移量hash值 $txid = "f141ffe8c85ebcc6448d17751897d627.."; // 輸入預計算的原本獎號 $number = 150; // 預設偏移量為 0-255 $shift_offset = 255; // 總共幾個籤數 $tag_count = 350; $dec = gmp_init($txid, 16); $mod = gmp_mod($dec, $shift_offset); $shift_number = (int)gmp_strval($mod) + $number; if ($shift_number > $tag_count) { $shift_number = $shift_number % $tag_count; if ($shift_number == 0) { $shift_number = $tag_count; } } echo $shift_number;
Output for 8.1.14 - 8.1.29, 8.2.19 - 8.2.23, 8.3.5 - 8.3.11
Fatal error: Uncaught ValueError: gmp_init(): Argument #1 ($num) is not an integer string in /in/vvukC:15 Stack trace: #0 /in/vvukC(15): gmp_init('f141ffe8c85ebcc...', 16) #1 {main} thrown in /in/vvukC on line 15
Process exited with code 255.

preferences:
52.36 ms | 406 KiB | 5 Q