3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xor_this_with($input, $key = '') { $return = ''; $length = strlen($input); $key_length = strlen($key); for ($i = 0; $i < $length; $i++) { $tmp = $input[$i]; for ($j = 0; $j < $key_length; $j++) { $tmp = chr(ord($tmp) ^ ord($key[$j])); } $hash .= $tmp; } return $return; } $iv = base64_decode('ifblUEQdFIheTrKCCfURRzEvu9h4xwlX2cElHybes90='); $plain = 's:1:"1";'; $padded = str_pad($plain, 32); $hash = xor_this_with($iv, $plain); $hash = xor_this_with($hash, $padded); print base64_encode($hash);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5AuXU
function name:  (null)
number of ops:  25
compiled vars:  !0 = $iv, !1 = $plain, !2 = $padded, !3 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'base64_decode'
          1        SEND_VAL                                                 'ifblUEQdFIheTrKCCfURRzEvu9h4xwlX2cElHybes90%3D'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   23     4        ASSIGN                                                   !1, 's%3A1%3A%221%22%3B'
   24     5        INIT_FCALL                                               'str_pad'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 32
          8        DO_ICALL                                         $7      
          9        ASSIGN                                                   !2, $7
   25    10        INIT_FCALL                                               'xor_this_with'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_FCALL                                      0  $9      
         14        ASSIGN                                                   !3, $9
   26    15        INIT_FCALL                                               'xor_this_with'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !2
         18        DO_FCALL                                      0  $11     
         19        ASSIGN                                                   !3, $11
   28    20        INIT_FCALL                                               'base64_encode'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $13     
         23        ECHO                                                     $13
         24      > RETURN                                                   1

Function xor_this_with:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 9
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 13
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 9
Branch analysis from position: 32
Branch analysis from position: 9
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 13
Branch analysis from position: 28
Branch analysis from position: 13
filename:       /in/5AuXU
function name:  xor_this_with
number of ops:  34
compiled vars:  !0 = $input, !1 = $key, !2 = $return, !3 = $length, !4 = $key_length, !5 = $i, !6 = $tmp, !7 = $j, !8 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    4     2        ASSIGN                                                   !2, ''
    5     3        STRLEN                                           ~10     !0
          4        ASSIGN                                                   !3, ~10
    6     5        STRLEN                                           ~12     !1
          6        ASSIGN                                                   !4, ~12
    8     7        ASSIGN                                                   !5, 0
          8      > JMP                                                      ->30
    9     9    >   FETCH_DIM_R                                      ~15     !0, !5
         10        ASSIGN                                                   !6, ~15
   11    11        ASSIGN                                                   !7, 0
         12      > JMP                                                      ->26
   12    13    >   INIT_FCALL                                               'chr'
         14        INIT_FCALL                                               'ord'
         15        SEND_VAR                                                 !6
         16        DO_ICALL                                         $18     
         17        INIT_FCALL                                               'ord'
         18        FETCH_DIM_R                                      ~19     !1, !7
         19        SEND_VAL                                                 ~19
         20        DO_ICALL                                         $20     
         21        BW_XOR                                           ~21     $18, $20
         22        SEND_VAL                                                 ~21
         23        DO_ICALL                                         $22     
         24        ASSIGN                                                   !6, $22
   11    25        PRE_INC                                                  !7
         26    >   IS_SMALLER                                               !7, !4
         27      > JMPNZ                                                    ~25, ->13
   15    28    >   ASSIGN_OP                                     8          !8, !6
    8    29        PRE_INC                                                  !5
         30    >   IS_SMALLER                                               !5, !3
         31      > JMPNZ                                                    ~28, ->9
   18    32    > > RETURN                                                   !2
   19    33*     > RETURN                                                   null

End of function xor_this_with

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.69 ms | 1403 KiB | 25 Q