3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "hello, this is evening, and this is SO"; $key = 21344124124214124324512124124; function encrypt( $text, $xorKey ) { $xored = ''; $chars = str_split( $text ); $i = 0; while ( $i < count( $chars ) ) { $xored .= chr( ord( $chars[$i] ) ^ $xorKey ); $i++; } return $xored; } $encrypted = encrypt($string, $key); echo $encrypted; // hello, this is evening, and this is SO
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ThMin
function name:  (null)
number of ops:  9
compiled vars:  !0 = $string, !1 = $key, !2 = $encrypted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'hello%2C+this+is+evening%2C+and+this+is+SO'
    3     1        ASSIGN                                                   !1, 2.13441e+28
   19     2        INIT_FCALL                                               'encrypt'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !2, $5
   21     7        ECHO                                                     !2
          8      > RETURN                                                   1

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

End of function encrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.71 ms | 1403 KiB | 20 Q