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) { var_dump($m); $key = $val = 0; foreach (str_split($m[1]) as $i => $c){ echo ord($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/VYN9k
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     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 = 77) Position 1 = 20, Position 2 = 66
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 66
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 45
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 45
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 45
2 jumps found. (Code = 77) Position 1 = 51, Position 2 = 61
Branch analysis from position: 51
2 jumps found. (Code = 78) Position 1 = 52, Position 2 = 61
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 61
Branch analysis from position: 45
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 66
filename:       /in/VYN9k
function name:  ved_decode
number of ops:  69
compiled vars:  !0 = $ved, !1 = $matches, !2 = $m, !3 = $key, !4 = $val, !5 = $c, !6 = $i, !7 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'preg_match_all'
          2        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'
   18     3        INIT_FCALL                                               'base64_decode'
          4        INIT_FCALL                                               'str_replace'
          5        SEND_VAL                                                 <array>
          6        SEND_VAL                                                 <array>
          7        INIT_FCALL                                               'substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        SEND_VAR                                                 $9
         14        DO_ICALL                                         $10     
         15        SEND_VAR                                                 $10
   19    16        SEND_REF                                                 !1
         17        SEND_VAL                                                 2
         18        DO_ICALL                                                 
   20    19      > FE_RESET_R                                       $12     !1, ->66
         20    > > FE_FETCH_R                                               $12, !2, ->66
   21    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
   22    24        ASSIGN                                           ~14     !4, 0
         25        ASSIGN                                                   !3, ~14
   23    26        INIT_FCALL                                               'str_split'
         27        FETCH_DIM_R                                      ~16     !2, 1
         28        SEND_VAL                                                 ~16
         29        DO_ICALL                                         $17     
         30      > FE_RESET_R                                       $18     $17, ->45
         31    > > FE_FETCH_R                                       ~19     $18, !5, ->45
         32    >   ASSIGN                                                   !6, ~19
   24    33        INIT_FCALL                                               'ord'
         34        SEND_VAR                                                 !5
         35        DO_ICALL                                         $21     
         36        ECHO                                                     $21
   25    37        INIT_FCALL                                               'ord'
         38        SEND_VAR                                                 !5
         39        DO_ICALL                                         $22     
         40        BW_AND                                           ~23     $22, 127
         41        MUL                                              ~24     !6, 7
         42        SL                                               ~25     ~23, ~24
         43        ASSIGN_OP                                     1          !3, ~25
   23    44      > JMP                                                      ->31
         45    >   FE_FREE                                                  $18
   28    46        INIT_FCALL                                               'str_split'
         47        FETCH_DIM_R                                      ~27     !2, 2
         48        SEND_VAL                                                 ~27
         49        DO_ICALL                                         $28     
         50      > FE_RESET_R                                       $29     $28, ->61
         51    > > FE_FETCH_R                                       ~30     $29, !5, ->61
         52    >   ASSIGN                                                   !6, ~30
   29    53        INIT_FCALL                                               'ord'
         54        SEND_VAR                                                 !5
         55        DO_ICALL                                         $32     
         56        BW_AND                                           ~33     $32, 127
         57        MUL                                              ~34     !6, 7
         58        SL                                               ~35     ~33, ~34
         59        ASSIGN_OP                                     1          !4, ~35
   28    60      > JMP                                                      ->51
         61    >   FE_FREE                                                  $29
   32    62        SR                                               ~37     !3, 3
         63        ASSIGN_DIM                                               !7, ~37
         64        OP_DATA                                                  !4
   20    65      > JMP                                                      ->20
         66    >   FE_FREE                                                  $12
   34    67      > RETURN                                                   !7
   35    68*     > RETURN                                                   null

End of function ved_decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.68 ms | 1407 KiB | 30 Q