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) $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/Os0pV
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     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 = 95
Branch analysis from position: 53
2 jumps found. (Code = 78) Position 1 = 54, Position 2 = 95
Branch analysis from position: 54
2 jumps found. (Code = 77) Position 1 = 64, Position 2 = 74
Branch analysis from position: 64
2 jumps found. (Code = 78) Position 1 = 65, Position 2 = 74
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
Branch analysis from position: 74
2 jumps found. (Code = 77) Position 1 = 80, Position 2 = 90
Branch analysis from position: 80
2 jumps found. (Code = 78) Position 1 = 81, Position 2 = 90
Branch analysis from position: 81
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 90
Branch analysis from position: 74
Branch analysis from position: 95
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 95
filename:       /in/Os0pV
function name:  ved_decode
number of ops:  98
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, ->95
         53    > > FE_FETCH_R                                               $28, !4, ->95
   19    54    >   INIT_FCALL                                               'var_dump'
         55        SEND_VAR                                                 !4
         56        DO_ICALL                                                 
   20    57        ASSIGN                                           ~30     !6, 0
         58        ASSIGN                                                   !5, ~30
   21    59        INIT_FCALL                                               'str_split'
         60        FETCH_DIM_R                                      ~32     !4, 1
         61        SEND_VAL                                                 ~32
         62        DO_ICALL                                         $33     
         63      > FE_RESET_R                                       $34     $33, ->74
         64    > > FE_FETCH_R                                       ~35     $34, !7, ->74
         65    >   ASSIGN                                                   !8, ~35
         66        INIT_FCALL                                               'ord'
         67        SEND_VAR                                                 !7
         68        DO_ICALL                                         $37     
         69        BW_AND                                           ~38     $37, 127
         70        MUL                                              ~39     !8, 7
         71        SL                                               ~40     ~38, ~39
         72        ASSIGN_OP                                     1          !5, ~40
         73      > JMP                                                      ->64
         74    >   FE_FREE                                                  $34
   22    75        INIT_FCALL                                               'str_split'
         76        FETCH_DIM_R                                      ~42     !4, 2
         77        SEND_VAL                                                 ~42
         78        DO_ICALL                                         $43     
         79      > FE_RESET_R                                       $44     $43, ->90
         80    > > FE_FETCH_R                                       ~45     $44, !7, ->90
         81    >   ASSIGN                                                   !8, ~45
         82        INIT_FCALL                                               'ord'
         83        SEND_VAR                                                 !7
         84        DO_ICALL                                         $47     
         85        BW_AND                                           ~48     $47, 127
         86        MUL                                              ~49     !8, 7
         87        SL                                               ~50     ~48, ~49
         88        ASSIGN_OP                                     1          !6, ~50
         89      > JMP                                                      ->80
         90    >   FE_FREE                                                  $44
   23    91        SR                                               ~52     !5, 3
         92        ASSIGN_DIM                                               !2, ~52
         93        OP_DATA                                                  !6
   18    94      > JMP                                                      ->53
         95    >   FE_FREE                                                  $28
   25    96      > RETURN                                                   !2
   26    97*     > RETURN                                                   null

End of function ved_decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.88 ms | 1407 KiB | 30 Q