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;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 27
filename:       /in/vvukC
function name:  (null)
number of ops:  29
compiled vars:  !0 = $txid, !1 = $number, !2 = $shift_offset, !3 = $tag_count, !4 = $dec, !5 = $mod, !6 = $shift_number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'f141ffe8c85ebcc6448d17751897d627..'
    7     1        ASSIGN                                                   !1, 150
   10     2        ASSIGN                                                   !2, 255
   13     3        ASSIGN                                                   !3, 350
   15     4        INIT_FCALL_BY_NAME                                       'gmp_init'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAL_EX                                              16
          7        DO_FCALL                                      0  $11     
          8        ASSIGN                                                   !4, $11
   17     9        INIT_FCALL_BY_NAME                                       'gmp_mod'
         10        SEND_VAR_EX                                              !4
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $13     
         13        ASSIGN                                                   !5, $13
   19    14        INIT_FCALL_BY_NAME                                       'gmp_strval'
         15        SEND_VAR_EX                                              !5
         16        DO_FCALL                                      0  $15     
         17        CAST                                          4  ~16     $15
         18        ADD                                              ~17     ~16, !1
         19        ASSIGN                                                   !6, ~17
   21    20        IS_SMALLER                                               !3, !6
         21      > JMPZ                                                     ~19, ->27
   22    22    >   MOD                                              ~20     !6, !3
         23        ASSIGN                                                   !6, ~20
   24    24        IS_EQUAL                                                 !6, 0
         25      > JMPZ                                                     ~22, ->27
   25    26    >   ASSIGN                                                   !6, !3
   29    27    >   ECHO                                                     !6
   30    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.27 ms | 1449 KiB | 13 Q