3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ved_decode($ved) { // Copyright 2013 Deed Poll Office Ltd, UK <https://deedpolloffice.com> // Licensed under Apache Licence v2.0 <http://apache.org/licenses/LICENSE-2.0> $keys = array('t' => 2, 'r' => 6, 's' => 7, 'i' => 1); $ret = array(); if (substr($ved, 0, 1) == '1') { preg_match_all('/([a-z]+):([0-9]+)/i', $ved, $matches, PREG_SET_ORDER); foreach ($matches as $m) $ret[isset($keys[$m[1]]) ? $keys[$m[1]] : $m[1]] = (int) $m[2]; return $ret; } preg_match_all('/([\x80-\xff]*[\0-\x7f])([\x80-\xff]*[\0-\x7f])/', base64_decode(str_replace(array('_','-'), array('+','/'), substr($ved, 1))), $matches, PREG_SET_ORDER); foreach ($matches as $m) { $key = $val = 0; foreach (str_split($m[1]) as $i => $c) $key += (ord($c) & 0x7f) << $i * 7; foreach (str_split($m[2]) as $i => $c) $val += (ord($c) & 0x7f) << $i * 7; $ret[$key >> 3] = $val; } return $ret; } // Example of use: print_r(ved_decode('ahUKEwiHlMTro9_bAhVEtxQKHbTpDKAQFgiIAjAL'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BB8lG
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'ved_decode'
          2        SEND_VAL                                                 'ahUKEwiHlMTro9_bAhVEtxQKHbTpDKAQFgiIAjAL'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function ved_decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 34
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 32
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 32
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 34
2 jumps found. (Code = 77) Position 1 = 53, Position 2 = 92
Branch analysis from position: 53
2 jumps found. (Code = 78) Position 1 = 54, Position 2 = 92
Branch analysis from position: 54
2 jumps found. (Code = 77) Position 1 = 61, Position 2 = 71
Branch analysis from position: 61
2 jumps found. (Code = 78) Position 1 = 62, Position 2 = 71
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 71
2 jumps found. (Code = 77) Position 1 = 77, Position 2 = 87
Branch analysis from position: 77
2 jumps found. (Code = 78) Position 1 = 78, Position 2 = 87
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 87
Branch analysis from position: 71
Branch analysis from position: 92
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 92
filename:       /in/BB8lG
function name:  ved_decode
number of ops:  95
compiled vars:  !0 = $ved, !1 = $keys, !2 = $ret, !3 = $matches, !4 = $m, !5 = $key, !6 = $val, !7 = $c, !8 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, <array>
    8     2        ASSIGN                                                   !2, <array>
    9     3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $11     
          8        IS_EQUAL                                                 $11, '1'
          9      > JMPZ                                                     ~12, ->34
   10    10    >   INIT_FCALL                                               'preg_match_all'
         11        SEND_VAL                                                 '%2F%28%5Ba-z%5D%2B%29%3A%28%5B0-9%5D%2B%29%2Fi'
         12        SEND_VAR                                                 !0
         13        SEND_REF                                                 !3
         14        SEND_VAL                                                 2
         15        DO_ICALL                                                 
   11    16      > FE_RESET_R                                       $14     !3, ->32
         17    > > FE_FETCH_R                                               $14, !4, ->32
   12    18    >   FETCH_DIM_R                                      ~15     !4, 1
         19        ISSET_ISEMPTY_DIM_OBJ                         0          !1, ~15
         20      > JMPZ                                                     ~16, ->25
         21    >   FETCH_DIM_R                                      ~17     !4, 1
         22        FETCH_DIM_R                                      ~18     !1, ~17
         23        QM_ASSIGN                                        ~19     ~18
         24      > JMP                                                      ->27
         25    >   FETCH_DIM_R                                      ~20     !4, 1
         26        QM_ASSIGN                                        ~19     ~20
         27    >   FETCH_DIM_R                                      ~22     !4, 2
         28        CAST                                          4  ~23     ~22
         29        ASSIGN_DIM                                               !2, ~19
         30        OP_DATA                                                  ~23
   11    31      > JMP                                                      ->17
         32    >   FE_FREE                                                  $14
   13    33      > RETURN                                                   !2
   15    34    >   INIT_FCALL                                               'preg_match_all'
         35        SEND_VAL                                                 '%2F%28%5B%5Cx80-%5Cxff%5D%2A%5B%5C0-%5Cx7f%5D%29%28%5B%5Cx80-%5Cxff%5D%2A%5B%5C0-%5Cx7f%5D%29%2F'
   16    36        INIT_FCALL                                               'base64_decode'
         37        INIT_FCALL                                               'str_replace'
         38        SEND_VAL                                                 <array>
         39        SEND_VAL                                                 <array>
         40        INIT_FCALL                                               'substr'
         41        SEND_VAR                                                 !0
         42        SEND_VAL                                                 1
         43        DO_ICALL                                         $24     
         44        SEND_VAR                                                 $24
         45        DO_ICALL                                         $25     
         46        SEND_VAR                                                 $25
         47        DO_ICALL                                         $26     
         48        SEND_VAR                                                 $26
   17    49        SEND_REF                                                 !3
         50        SEND_VAL                                                 2
         51        DO_ICALL                                                 
   18    52      > FE_RESET_R                                       $28     !3, ->92
         53    > > FE_FETCH_R                                               $28, !4, ->92
   19    54    >   ASSIGN                                           ~29     !6, 0
         55        ASSIGN                                                   !5, ~29
   20    56        INIT_FCALL                                               'str_split'
         57        FETCH_DIM_R                                      ~31     !4, 1
         58        SEND_VAL                                                 ~31
         59        DO_ICALL                                         $32     
         60      > FE_RESET_R                                       $33     $32, ->71
         61    > > FE_FETCH_R                                       ~34     $33, !7, ->71
         62    >   ASSIGN                                                   !8, ~34
         63        INIT_FCALL                                               'ord'
         64        SEND_VAR                                                 !7
         65        DO_ICALL                                         $36     
         66        BW_AND                                           ~37     $36, 127
         67        MUL                                              ~38     !8, 7
         68        SL                                               ~39     ~37, ~38
         69        ASSIGN_OP                                     1          !5, ~39
         70      > JMP                                                      ->61
         71    >   FE_FREE                                                  $33
   21    72        INIT_FCALL                                               'str_split'
         73        FETCH_DIM_R                                      ~41     !4, 2
         74        SEND_VAL                                                 ~41
         75        DO_ICALL                                         $42     
         76      > FE_RESET_R                                       $43     $42, ->87
         77    > > FE_FETCH_R                                       ~44     $43, !7, ->87
         78    >   ASSIGN                                                   !8, ~44
         79        INIT_FCALL                                               'ord'
         80        SEND_VAR                                                 !7
         81        DO_ICALL                                         $46     
         82        BW_AND                                           ~47     $46, 127
         83        MUL                                              ~48     !8, 7
         84        SL                                               ~49     ~47, ~48
         85        ASSIGN_OP                                     1          !6, ~49
         86      > JMP                                                      ->77
         87    >   FE_FREE                                                  $43
   22    88        SR                                               ~51     !5, 3
         89        ASSIGN_DIM                                               !2, ~51
         90        OP_DATA                                                  !6
   18    91      > JMP                                                      ->53
         92    >   FE_FREE                                                  $28
   24    93      > RETURN                                                   !2
   25    94*     > RETURN                                                   null

End of function ved_decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.9 ms | 1407 KiB | 28 Q