3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 請代入本平台提供的 hash 值並填入在單引號內 $txid = '799746d145f88f3d5514b40844e076cf1bcde7d1b167993a26ac7a641446e85d'; // 總共幾個大賞 $prize_count = 13; // 總共幾個籤數 $tag_count = 350; $dec = gmp_init($txid, 16); $prize_tmp = []; $prize_tmp_count = 0; $step_tmp = 100; $step = 1; $max_count = 100; try { while ($step <= $max_count) { $powResult = gmp_pow($step_tmp, $step); $div = gmp_div_q($dec, $powResult); $mod = gmp_mod($div, $tag_count); $prize_number = (int)gmp_strval($mod) + 1; if (!in_array($prize_number, $prize_tmp)) { $prize_tmp[] = $prize_number; $prize_tmp_count++; } if ($prize_tmp_count >= $prize_count) { break; } $step++; } echo implode(', ', $prize_tmp); } catch (\Exception $e) { echo $e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 14
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 44
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 47
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 14
Branch analysis from position: 50
Branch analysis from position: 14
Branch analysis from position: 44
Found catch point at position: 56
Branch analysis from position: 56
2 jumps found. (Code = 107) Position 1 = 57, Position 2 = -2
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rD2S4
function name:  (null)
number of ops:  61
compiled vars:  !0 = $txid, !1 = $prize_count, !2 = $tag_count, !3 = $dec, !4 = $prize_tmp, !5 = $prize_tmp_count, !6 = $step_tmp, !7 = $step, !8 = $max_count, !9 = $powResult, !10 = $div, !11 = $mod, !12 = $prize_number, !13 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '799746d145f88f3d5514b40844e076cf1bcde7d1b167993a26ac7a641446e85d'
    6     1        ASSIGN                                                   !1, 13
    9     2        ASSIGN                                                   !2, 350
   11     3        INIT_FCALL_BY_NAME                                       'gmp_init'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              16
          6        DO_FCALL                                      0  $17     
          7        ASSIGN                                                   !3, $17
   13     8        ASSIGN                                                   !4, <array>
   14     9        ASSIGN                                                   !5, 0
   16    10        ASSIGN                                                   !6, 100
   17    11        ASSIGN                                                   !7, 1
   18    12        ASSIGN                                                   !8, 100
   22    13      > JMP                                                      ->48
   24    14    >   INIT_FCALL_BY_NAME                                       'gmp_pow'
         15        SEND_VAR_EX                                              !6
         16        SEND_VAR_EX                                              !7
         17        DO_FCALL                                      0  $24     
         18        ASSIGN                                                   !9, $24
   26    19        INIT_FCALL_BY_NAME                                       'gmp_div_q'
         20        SEND_VAR_EX                                              !3
         21        SEND_VAR_EX                                              !9
         22        DO_FCALL                                      0  $26     
         23        ASSIGN                                                   !10, $26
   28    24        INIT_FCALL_BY_NAME                                       'gmp_mod'
         25        SEND_VAR_EX                                              !10
         26        SEND_VAR_EX                                              !2
         27        DO_FCALL                                      0  $28     
         28        ASSIGN                                                   !11, $28
   30    29        INIT_FCALL_BY_NAME                                       'gmp_strval'
         30        SEND_VAR_EX                                              !11
         31        DO_FCALL                                      0  $30     
         32        CAST                                          4  ~31     $30
         33        ADD                                              ~32     ~31, 1
         34        ASSIGN                                                   !12, ~32
   32    35        INIT_FCALL                                               'in_array'
         36        SEND_VAR                                                 !12
         37        SEND_VAR                                                 !4
         38        DO_ICALL                                         $34     
         39        BOOL_NOT                                         ~35     $34
         40      > JMPZ                                                     ~35, ->44
   33    41    >   ASSIGN_DIM                                               !4
         42        OP_DATA                                                  !12
   34    43        PRE_INC                                                  !5
   37    44    >   IS_SMALLER_OR_EQUAL                                      !1, !5
         45      > JMPZ                                                     ~38, ->47
   38    46    > > JMP                                                      ->50
   41    47    >   PRE_INC                                                  !7
   22    48    >   IS_SMALLER_OR_EQUAL                                      !7, !8
         49      > JMPNZ                                                    ~40, ->14
   44    50    >   INIT_FCALL                                               'implode'
         51        SEND_VAL                                                 '%2C+'
         52        SEND_VAR                                                 !4
         53        DO_ICALL                                         $41     
         54        ECHO                                                     $41
         55      > JMP                                                      ->60
   46    56  E > > CATCH                                       last         'Exception'
   47    57    >   INIT_METHOD_CALL                                         !13, 'getMessage'
         58        DO_FCALL                                      0  $42     
         59        ECHO                                                     $42
   48    60    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.94 ms | 1465 KiB | 15 Q