3v4l.org

run code in 300+ PHP versions simultaneously
<?php function from62to10($num) { $from = 62; $num = strval($num); $dict = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $len = strlen($num); $dec = 0; for($i = 0; $i < $len; $i++) { $pos = strpos($dict, $num[$i]); $dec = bcadd(bcmul(bcpow($from, $len - $i - 1), $pos), $dec); } return $dec; } function decode($url) { $file = basename($url,'.jpg'); $code = substr($file, 0, 8); if (substr($code, 0, 2) == '00') { return from62to10($code); } else { return hexdec($code); } } $url = 'http://ww3.sinaimg.cn/large/0060lm7Tly1fj8dcbq7bcj30f0076jr7.jpg'; $weibo = 'http://weibo.com/u/' . decode($url); echo $weibo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2J3FH
function name:  (null)
number of ops:  8
compiled vars:  !0 = $url, !1 = $weibo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fww3.sinaimg.cn%2Flarge%2F0060lm7Tly1fj8dcbq7bcj30f0076jr7.jpg'
   30     1        INIT_FCALL                                               'decode'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        CONCAT                                           ~4      'http%3A%2F%2Fweibo.com%2Fu%2F', $3
          5        ASSIGN                                                   !1, ~4
   32     6        ECHO                                                     !1
          7      > RETURN                                                   1

Function from62to10:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 10
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 10
Branch analysis from position: 34
Branch analysis from position: 10
filename:       /in/2J3FH
function name:  from62to10
number of ops:  36
compiled vars:  !0 = $num, !1 = $from, !2 = $dict, !3 = $len, !4 = $dec, !5 = $i, !6 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, 62
    7     2        CAST                                          6  ~8      !0
          3        ASSIGN                                                   !0, ~8
    8     4        ASSIGN                                                   !2, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    9     5        STRLEN                                           ~11     !0
          6        ASSIGN                                                   !3, ~11
   10     7        ASSIGN                                                   !4, 0
   11     8        ASSIGN                                                   !5, 0
          9      > JMP                                                      ->32
   12    10    >   INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !2
         12        FETCH_DIM_R                                      ~15     !0, !5
         13        SEND_VAL                                                 ~15
         14        DO_ICALL                                         $16     
         15        ASSIGN                                                   !6, $16
   13    16        INIT_FCALL_BY_NAME                                       'bcadd'
         17        INIT_FCALL_BY_NAME                                       'bcmul'
         18        INIT_FCALL_BY_NAME                                       'bcpow'
         19        SEND_VAR_EX                                              !1
         20        SUB                                              ~18     !3, !5
         21        SUB                                              ~19     ~18, 1
         22        SEND_VAL_EX                                              ~19
         23        DO_FCALL                                      0  $20     
         24        SEND_VAR_NO_REF_EX                                       $20
         25        SEND_VAR_EX                                              !6
         26        DO_FCALL                                      0  $21     
         27        SEND_VAR_NO_REF_EX                                       $21
         28        SEND_VAR_EX                                              !4
         29        DO_FCALL                                      0  $22     
         30        ASSIGN                                                   !4, $22
   11    31        PRE_INC                                                  !5
         32    >   IS_SMALLER                                               !5, !3
         33      > JMPNZ                                                    ~25, ->10
   15    34    > > RETURN                                                   !4
   16    35*     > RETURN                                                   null

End of function from62to10

Function decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2J3FH
function name:  decode
number of ops:  29
compiled vars:  !0 = $url, !1 = $file, !2 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'basename'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '.jpg'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   20     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 8
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !2, $5
   21    12        INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 0
         15        SEND_VAL                                                 2
         16        DO_ICALL                                         $7      
         17        IS_EQUAL                                                 $7, '00'
         18      > JMPZ                                                     ~8, ->24
   22    19    >   INIT_FCALL                                               'from62to10'
         20        SEND_VAR                                                 !2
         21        DO_FCALL                                      0  $9      
         22      > RETURN                                                   $9
         23*       JMP                                                      ->28
   24    24    >   INIT_FCALL                                               'hexdec'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $10     
         27      > RETURN                                                   $10
   26    28*     > RETURN                                                   null

End of function decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.69 ms | 1402 KiB | 23 Q