3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ei_decode($ei) { // Copyright 2013 Deed Poll Office Ltd, UK <https://deedpolloffice.com> // Licensed under Apache Licence v2.0 <http://apache.org/licenses/LICENSE-2.0> $ei = base64_decode(str_replace(array('_', '-'), array('+', '/'), $ei)); if (!preg_match('/^ (.{4}) ((?:[\x80-\xff]*[\0-\x7f])+) $/sx', $ei, $matches)) return false; // Non-valid ei value $ret = array(); $val = 0; foreach (str_split($matches[1]) as $i => $c) $val = PHP_INT_SIZE < 5 && function_exists('bcadd') ? bcadd($val, bcmul(ord($c), bcpow(2, $i * 8))) : $val + (ord($c) << $i * 8); $ret[0] = $val; preg_match_all('/[\x80-\xff]*[\0-\x7f]/', $matches[2], $matches, PREG_SET_ORDER); foreach ($matches as $j => $match) { $val = 0; foreach (str_split($match[0]) as $i => $c) $val = PHP_INT_SIZE < 8 && function_exists('bcadd') ? bcadd($val, bcmul(ord($c) & 0x7f, bcpow(2, $i * 7))) : $val + ((ord($c) & 0x7f) << $i * 7); $ret[$j + 1] = $val; } return $ret; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3YIrB
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   1

Function ei_decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 55
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 55
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 46
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 55
2 jumps found. (Code = 77) Position 1 = 66, Position 2 = 111
Branch analysis from position: 66
2 jumps found. (Code = 78) Position 1 = 67, Position 2 = 111
Branch analysis from position: 67
2 jumps found. (Code = 77) Position 1 = 74, Position 2 = 106
Branch analysis from position: 74
2 jumps found. (Code = 78) Position 1 = 75, Position 2 = 106
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 96
Branch analysis from position: 77
1 jumps found. (Code = 42) Position 1 = 104
Branch analysis from position: 104
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 96
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 106
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 106
Branch analysis from position: 111
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 111
Branch analysis from position: 55
filename:       /in/3YIrB
function name:  ei_decode
number of ops:  114
compiled vars:  !0 = $ei, !1 = $matches, !2 = $ret, !3 = $val, !4 = $c, !5 = $i, !6 = $match, !7 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'base64_decode'
          2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 <array>
          4        SEND_VAL                                                 <array>
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $8      
          7        SEND_VAR                                                 $8
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !0, $9
    7    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%2F%5E%0A++++++++%28.%7B4%7D%29%0A++++++++%28%28%3F%3A%5B%5Cx80-%5Cxff%5D%2A%5B%5C0-%5Cx7f%5D%29%2B%29%0A++++++++%24%2Fsx'
   10    12        SEND_VAR                                                 !0
         13        SEND_REF                                                 !1
         14        DO_ICALL                                         $11     
         15        BOOL_NOT                                         ~12     $11
         16      > JMPZ                                                     ~12, ->18
         17    > > RETURN                                                   <false>
   11    18    >   ASSIGN                                                   !2, <array>
   12    19        ASSIGN                                                   !3, 0
   13    20        INIT_FCALL                                               'str_split'
         21        FETCH_DIM_R                                      ~15     !1, 1
         22        SEND_VAL                                                 ~15
         23        DO_ICALL                                         $16     
         24      > FE_RESET_R                                       $17     $16, ->55
         25    > > FE_FETCH_R                                       ~18     $17, !4, ->55
         26    >   ASSIGN                                                   !5, ~18
   14    27      > JMPZ                                                     <false>, ->46
   15    28    >   INIT_FCALL_BY_NAME                                       'bcadd'
         29        SEND_VAR_EX                                              !3
         30        INIT_FCALL_BY_NAME                                       'bcmul'
         31        INIT_FCALL                                               'ord'
         32        SEND_VAR                                                 !4
         33        DO_ICALL                                         $20     
         34        SEND_VAR_NO_REF_EX                                       $20
         35        INIT_FCALL_BY_NAME                                       'bcpow'
         36        SEND_VAL_EX                                              2
         37        MUL                                              ~21     !5, 8
         38        SEND_VAL_EX                                              ~21
         39        DO_FCALL                                      0  $22     
         40        SEND_VAR_NO_REF_EX                                       $22
         41        DO_FCALL                                      0  $23     
         42        SEND_VAR_NO_REF_EX                                       $23
         43        DO_FCALL                                      0  $24     
         44        QM_ASSIGN                                        ~25     $24
         45      > JMP                                                      ->53
   16    46    >   INIT_FCALL                                               'ord'
         47        SEND_VAR                                                 !4
         48        DO_ICALL                                         $26     
         49        MUL                                              ~27     !5, 8
         50        SL                                               ~28     $26, ~27
         51        ADD                                              ~29     !3, ~28
         52        QM_ASSIGN                                        ~25     ~29
   14    53    >   ASSIGN                                                   !3, ~25
   13    54      > JMP                                                      ->25
         55    >   FE_FREE                                                  $17
   17    56        ASSIGN_DIM                                               !2, 0
         57        OP_DATA                                                  !3
   18    58        INIT_FCALL                                               'preg_match_all'
         59        SEND_VAL                                                 '%2F%5B%5Cx80-%5Cxff%5D%2A%5B%5C0-%5Cx7f%5D%2F'
         60        FETCH_DIM_R                                      ~32     !1, 2
         61        SEND_VAL                                                 ~32
         62        SEND_REF                                                 !1
         63        SEND_VAL                                                 2
         64        DO_ICALL                                                 
   19    65      > FE_RESET_R                                       $34     !1, ->111
         66    > > FE_FETCH_R                                       ~35     $34, !6, ->111
         67    >   ASSIGN                                                   !7, ~35
   20    68        ASSIGN                                                   !3, 0
   21    69        INIT_FCALL                                               'str_split'
         70        FETCH_DIM_R                                      ~38     !6, 0
         71        SEND_VAL                                                 ~38
         72        DO_ICALL                                         $39     
         73      > FE_RESET_R                                       $40     $39, ->106
         74    > > FE_FETCH_R                                       ~41     $40, !4, ->106
         75    >   ASSIGN                                                   !5, ~41
   22    76      > JMPZ                                                     <false>, ->96
   23    77    >   INIT_FCALL_BY_NAME                                       'bcadd'
         78        SEND_VAR_EX                                              !3
         79        INIT_FCALL_BY_NAME                                       'bcmul'
         80        INIT_FCALL                                               'ord'
         81        SEND_VAR                                                 !4
         82        DO_ICALL                                         $43     
         83        BW_AND                                           ~44     $43, 127
         84        SEND_VAL_EX                                              ~44
         85        INIT_FCALL_BY_NAME                                       'bcpow'
         86        SEND_VAL_EX                                              2
         87        MUL                                              ~45     !5, 7
         88        SEND_VAL_EX                                              ~45
         89        DO_FCALL                                      0  $46     
         90        SEND_VAR_NO_REF_EX                                       $46
         91        DO_FCALL                                      0  $47     
         92        SEND_VAR_NO_REF_EX                                       $47
         93        DO_FCALL                                      0  $48     
         94        QM_ASSIGN                                        ~49     $48
         95      > JMP                                                      ->104
   24    96    >   INIT_FCALL                                               'ord'
         97        SEND_VAR                                                 !4
         98        DO_ICALL                                         $50     
         99        BW_AND                                           ~51     $50, 127
        100        MUL                                              ~52     !5, 7
        101        SL                                               ~53     ~51, ~52
        102        ADD                                              ~54     !3, ~53
        103        QM_ASSIGN                                        ~49     ~54
   22   104    >   ASSIGN                                                   !3, ~49
   21   105      > JMP                                                      ->74
        106    >   FE_FREE                                                  $40
   25   107        ADD                                              ~56     !7, 1
        108        ASSIGN_DIM                                               !2, ~56
        109        OP_DATA                                                  !3
   19   110      > JMP                                                      ->66
        111    >   FE_FREE                                                  $34
   27   112      > RETURN                                                   !2
   28   113*     > RETURN                                                   null

End of function ei_decode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.63 ms | 1404 KiB | 34 Q