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

End of function ved_decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.84 ms | 952 KiB | 31 Q