3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xor_encrypt($in) { $key = json_encode(array('showpassword' => 'no', 'color' => '#ffffff')); $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } print xor_encrypt(base64_decode('ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV4sFxFeaAw')); #print urlencode(base64_encode(xor_encrypt(json_encode(array('showpassword' => 'yes', 'color' => '#ffffff')))));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S5DNp
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'xor_encrypt'
          1        INIT_FCALL                                               'base64_decode'
          2        SEND_VAL                                                 'ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV4sFxFeaAw'
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_FCALL                                      0  $1      
          6        ECHO                                                     $1
   18     7      > RETURN                                                   1

Function xor_encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 9
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 9
Branch analysis from position: 19
Branch analysis from position: 9
filename:       /in/S5DNp
function name:  xor_encrypt
number of ops:  21
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        INIT_FCALL                                               'json_encode'
          2        SEND_VAL                                                 <array>
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    5     5        ASSIGN                                                   !2, !0
    6     6        ASSIGN                                                   !3, ''
    9     7        ASSIGN                                                   !4, 0
          8      > JMP                                                      ->16
   10     9    >   FETCH_DIM_R                                      ~10     !2, !4
         10        STRLEN                                           ~11     !1
         11        MOD                                              ~12     !4, ~11
         12        FETCH_DIM_R                                      ~13     !1, ~12
         13        BW_XOR                                           ~14     ~10, ~13
         14        ASSIGN_OP                                     8          !3, ~14
    9    15        PRE_INC                                                  !4
         16    >   STRLEN                                           ~17     !2
         17        IS_SMALLER                                               !4, ~17
         18      > JMPNZ                                                    ~18, ->9
   13    19    > > RETURN                                                   !3
   14    20*     > RETURN                                                   null

End of function xor_encrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
228.91 ms | 1398 KiB | 18 Q