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.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
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.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
48.65 ms | 407 KiB | 5 Q