3v4l.org

run code in 300+ PHP versions simultaneously
<?php function base16Encode($arg){ $ret = ''; for($i=0; $i < strlen($arg); $i++){ $tmp = ord(substr($arg, $i, 1)); $ret .= dechex($tmp); } return $ret; } function encode($text) { return bin2hex($text); } function decode($base16){ return pack("H*", $base16); } function encrypt($key, $link){ $cp = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', 'cbc', ''); @mcrypt_generic_init($cp, $key, $key); $enc = mcrypt_generic($cp, $link); mcrypt_generic_deinit($cp); mcrypt_module_close($cp); return $enc; } $key="KEY"; echo $transmitKey = base16Encode($key); echo "\r\n"; echo encode($key); $link="URL"; $crypted = base64_encode(encrypt($key, $link)); //echo $crypted;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1QgsT
function name:  (null)
number of ops:  21
compiled vars:  !0 = $key, !1 = $transmitKey, !2 = $link, !3 = $crypted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   ASSIGN                                                   !0, 'KEY'
   32     1        INIT_FCALL                                               'base16encode'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                           ~6      !1, $5
          5        ECHO                                                     ~6
   33     6        ECHO                                                     '%0D%0A'
   34     7        INIT_FCALL                                               'encode'
          8        SEND_VAR                                                 !0
          9        DO_FCALL                                      0  $7      
         10        ECHO                                                     $7
   35    11        ASSIGN                                                   !2, 'URL'
   37    12        INIT_FCALL                                               'base64_encode'
         13        INIT_FCALL                                               'encrypt'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !2
         16        DO_FCALL                                      0  $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !3, $10
   39    20      > RETURN                                                   1

Function base16encode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 4
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 4
Branch analysis from position: 21
Branch analysis from position: 4
filename:       /in/1QgsT
function name:  base16Encode
number of ops:  23
compiled vars:  !0 = $arg, !1 = $ret, !2 = $i, !3 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->18
    6     4    >   INIT_FCALL                                               'ord'
          5        INIT_FCALL                                               'substr'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !2
          8        SEND_VAL                                                 1
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !3, $7
    7    13        INIT_FCALL                                               'dechex'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $9      
         16        ASSIGN_OP                                     8          !1, $9
    5    17        PRE_INC                                                  !2
         18    >   STRLEN                                           ~12     !0
         19        IS_SMALLER                                               !2, ~12
         20      > JMPNZ                                                    ~13, ->4
   10    21    > > RETURN                                                   !1
   11    22*     > RETURN                                                   null

End of function base16encode

Function encode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1QgsT
function name:  encode
number of ops:  6
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'bin2hex'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   15     5*     > RETURN                                                   null

End of function encode

Function decode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1QgsT
function name:  decode
number of ops:  7
compiled vars:  !0 = $base16
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_FCALL                                               'pack'
          2        SEND_VAL                                                 'H%2A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   19     6*     > RETURN                                                   null

End of function decode

Function encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1QgsT
function name:  encrypt
number of ops:  30
compiled vars:  !0 = $key, !1 = $link, !2 = $cp, !3 = $enc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   22     2        INIT_FCALL_BY_NAME                                       'mcrypt_module_open'
          3        FETCH_CONSTANT                                   ~4      'MCRYPT_RIJNDAEL_128'
          4        SEND_VAL_EX                                              ~4
          5        SEND_VAL_EX                                              ''
          6        SEND_VAL_EX                                              'cbc'
          7        SEND_VAL_EX                                              ''
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !2, $5
   23    10        BEGIN_SILENCE                                    ~7      
         11        INIT_FCALL_BY_NAME                                       'mcrypt_generic_init'
         12        SEND_VAR_EX                                              !2
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
         16        END_SILENCE                                              ~7
   24    17        INIT_FCALL_BY_NAME                                       'mcrypt_generic'
         18        SEND_VAR_EX                                              !2
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $9      
         21        ASSIGN                                                   !3, $9
   25    22        INIT_FCALL_BY_NAME                                       'mcrypt_generic_deinit'
         23        SEND_VAR_EX                                              !2
         24        DO_FCALL                                      0          
   26    25        INIT_FCALL_BY_NAME                                       'mcrypt_module_close'
         26        SEND_VAR_EX                                              !2
         27        DO_FCALL                                      0          
   28    28      > RETURN                                                   !3
   29    29*     > RETURN                                                   null

End of function encrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.49 ms | 1407 KiB | 28 Q