3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xor_encrypt($in) { $key = "qw8J"; $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } function xor_two($in1,$in2) { $text = $in1; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $in2[$i]; } return $outText; } $defaultdata = array( "showpassword"=>"no", "bgcolor"=>"#ffffff"); print(json_encode($defaultdata)); print("\n"); print(xor_two(base64_decode("ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSRwh6QUcIaAw"), "{\"showpassword\":\"no\",\"bgcolor\":\"#000000\"}")); ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nRJIC
function name:  (null)
number of ops:  15
compiled vars:  !0 = $defaultdata
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   ASSIGN                                                   !0, <array>
   29     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ECHO                                                     $2
   31     5        ECHO                                                     '%0A'
   33     6        INIT_FCALL                                               'xor_two'
          7        INIT_FCALL                                               'base64_decode'
          8        SEND_VAL                                                 'ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSRwh6QUcIaAw'
          9        DO_ICALL                                         $3      
         10        SEND_VAR                                                 $3
         11        SEND_VAL                                                 '%7B%22showpassword%22%3A%22no%22%2C%22bgcolor%22%3A%22%23000000%22%7D'
         12        DO_FCALL                                      0  $4      
         13        ECHO                                                     $4
   34    14      > 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/nRJIC
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, 'qw8J'
    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

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

End of function xor_two

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.4 ms | 1403 KiB | 18 Q