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) & 0x7f) .'--'; $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/AJPq0
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 = 69
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 69
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 48
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 48
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 48
2 jumps found. (Code = 77) Position 1 = 54, Position 2 = 64
Branch analysis from position: 54
2 jumps found. (Code = 78) Position 1 = 55, Position 2 = 64
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 64
Branch analysis from position: 48
Branch analysis from position: 69
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
filename:       /in/AJPq0
function name:  ved_decode
number of ops:  72
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, ->69
         20    > > FE_FETCH_R                                               $12, !2, ->69
   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, ->48
         31    > > FE_FETCH_R                                       ~19     $18, !5, ->48
         32    >   ASSIGN                                                   !6, ~19
   24    33        INIT_FCALL                                               'ord'
         34        SEND_VAR                                                 !5
         35        DO_ICALL                                         $21     
         36        BW_AND                                           ~22     $21, 127
         37        CONCAT                                           ~23     '--', ~22
         38        CONCAT                                           ~24     ~23, '--'
         39        ECHO                                                     ~24
   25    40        INIT_FCALL                                               'ord'
         41        SEND_VAR                                                 !5
         42        DO_ICALL                                         $25     
         43        BW_AND                                           ~26     $25, 127
         44        MUL                                              ~27     !6, 7
         45        SL                                               ~28     ~26, ~27
         46        ASSIGN_OP                                     1          !3, ~28
   23    47      > JMP                                                      ->31
         48    >   FE_FREE                                                  $18
   28    49        INIT_FCALL                                               'str_split'
         50        FETCH_DIM_R                                      ~30     !2, 2
         51        SEND_VAL                                                 ~30
         52        DO_ICALL                                         $31     
         53      > FE_RESET_R                                       $32     $31, ->64
         54    > > FE_FETCH_R                                       ~33     $32, !5, ->64
         55    >   ASSIGN                                                   !6, ~33
   29    56        INIT_FCALL                                               'ord'
         57        SEND_VAR                                                 !5
         58        DO_ICALL                                         $35     
         59        BW_AND                                           ~36     $35, 127
         60        MUL                                              ~37     !6, 7
         61        SL                                               ~38     ~36, ~37
         62        ASSIGN_OP                                     1          !4, ~38
   28    63      > JMP                                                      ->54
         64    >   FE_FREE                                                  $32
   32    65        SR                                               ~40     !3, 3
         66        ASSIGN_DIM                                               !7, ~40
         67        OP_DATA                                                  !4
   20    68      > JMP                                                      ->20
         69    >   FE_FREE                                                  $12
   34    70      > RETURN                                                   !7
   35    71*     > RETURN                                                   null

End of function ved_decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.13 ms | 1407 KiB | 30 Q