3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xor_encrypt($in) { $key = '<censored>'; $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } $my_data = array( "showpassword"=>"no", "bgcolor"=>"#ffffff"); $my_data_e = base64_encode(xor_encrypt(json_encode($my_data))); echo "base64_decode = ".base64_decode("ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV4sFxFeaAw%3D")."\n"; echo "xor_encrypt =".xor_encrypt("UK\"H+O%pSWh]UZ-T%UhR^,^h 7"); echo "json_encode = ".json_encode($my_data); //echo $my_data_e;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ULenU
function name:  (null)
number of ops:  28
compiled vars:  !0 = $my_data, !1 = $my_data_e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, <array>
   17     1        INIT_FCALL                                               'base64_encode'
          2        INIT_FCALL                                               'xor_encrypt'
          3        INIT_FCALL                                               'json_encode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !1, $5
   18    11        INIT_FCALL                                               'base64_decode'
         12        SEND_VAL                                                 'ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV4sFxFeaAw%253D'
         13        DO_ICALL                                         $7      
         14        CONCAT                                           ~8      'base64_decode+%3D+', $7
         15        CONCAT                                           ~9      ~8, '%0A'
         16        ECHO                                                     ~9
   19    17        INIT_FCALL                                               'xor_encrypt'
         18        SEND_VAL                                                 'UK%22%1EH%2B%02%04O%25%03%13%1ApS%19Wh%5DUZ-%12%18T%25%03U%02hR%11%5E%2C%17%11%5Eh%0C7'
         19        DO_FCALL                                      0  $10     
         20        CONCAT                                           ~11     'xor_encrypt+%3D', $10
         21        ECHO                                                     ~11
   20    22        INIT_FCALL                                               'json_encode'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $12     
         25        CONCAT                                           ~13     'json_encode+%3D+', $12
         26        ECHO                                                     ~13
   22    27      > RETURN                                                   1

Function xor_encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/ULenU
function name:  xor_encrypt
number of ops:  18
compiled vars:  !0 = $in, !1 = $key, !2 = $text, !3 = $outText, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, '%3Ccensored%3E'
    5     2        ASSIGN                                                   !2, !0
    6     3        ASSIGN                                                   !3, ''
    9     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->13
   10     6    >   FETCH_DIM_R                                      ~9      !2, !4
          7        STRLEN                                           ~10     !1
          8        MOD                                              ~11     !4, ~10
          9        FETCH_DIM_R                                      ~12     !1, ~11
         10        BW_XOR                                           ~13     ~9, ~12
         11        ASSIGN_OP                                     8          !3, ~13
    9    12        PRE_INC                                                  !4
         13    >   STRLEN                                           ~16     !2
         14        IS_SMALLER                                               !4, ~16
         15      > JMPNZ                                                    ~17, ->6
   13    16    > > RETURN                                                   !3
   14    17*     > RETURN                                                   null

End of function xor_encrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.11 ms | 1403 KiB | 21 Q