3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function xor_encrypt() { $key = 'qw8J'; $text = json_encode(array("showpassword"=>"yes", "bgcolor"=>"#0000ff")); $outText = ''; for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } echo base64_encode(xor_encrypt()); ?>
based on nCntT
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 62) Position 1 = -2
filename:       /in/tiXJ9
function name:  (null)
number of ops:  8
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  17     1        INIT_FCALL                                               'base64_encode'
         2        INIT_FCALL                                               'xor_encrypt'
         3        DO_FCALL                                      0  $0      
         4        SEND_VAR                                                 $0
         5        DO_ICALL                                         $1      
         6        ECHO                                                     $1
  19     7      > RETURN                                                   1

Function xor_encrypt:
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Jump found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
Jump found. (Code = 44) Position 1 = 19, Position 2 = 8
Branch analysis from position: 19
Branch analysis from position: 8
filename:       /in/tiXJ9
function name:  xor_encrypt
number of ops:  21
compiled vars:  !0 = $key, !1 = $text, !2 = $outText, !3 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   ASSIGN                                                   !0, 'qw8J'
   5     1        INIT_FCALL                                               'json_encode'
         2        SEND_VAL                                                 <array>
         3        DO_ICALL                                         $5      
         4        ASSIGN                                                   !1, $5
   6     5        ASSIGN                                                   !2, ''
   8     6        ASSIGN                                                   !3, 0
         7      > JMP                                                      ->16
   9     8    >   FETCH_DIM_R                                      $9      !1, !3
         9        STRLEN                                           ~10     !0
        10        MOD                                              ~11     !3, ~10
        11        FETCH_DIM_R                                      $12     !0, ~11
        12        BW_XOR                                           ~13     $9, $12
        13        ASSIGN_CONCAT                                 0          !2, ~13
   8    14        POST_INC                                         ~15     !3
        15        FREE                                                     ~15
        16    >   STRLEN                                           ~16     !1
        17        IS_SMALLER                                       ~17     !3, ~16
        18      > JMPNZ                                                    ~17, ->8
  13    19    > > RETURN                                                   !2
  14    20*     > RETURN                                                   null

End of function xor_encrypt

Generated using Vulcan Logic Dumper, using php 7.3.0