3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pad_key($key){ // key is too large if(strlen($key) > 32) return false; // set sizes $sizes = array(16,24,32); // loop through sizes and pad key foreach($sizes as $s){ while(strlen($key) < $s) $key = $key."\0"; if(strlen($key) == $s) break; // finish if the key matches a size } // return return $key; } var_dump(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, pad_key("bite"), 717098756, MCRYPT_MODE_ECB)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kQNoA
function name:  (null)
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'base64_encode'
          2        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
          3        FETCH_CONSTANT                                   ~0      'MCRYPT_RIJNDAEL_256'
          4        SEND_VAL_EX                                              ~0
          5        INIT_FCALL                                               'pad_key'
          6        SEND_VAL                                                 'bite'
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR_NO_REF_EX                                       $1
          9        SEND_VAL_EX                                              717098756
         10        FETCH_CONSTANT                                   ~2      'MCRYPT_MODE_ECB'
         11        SEND_VAL_EX                                              ~2
         12        DO_FCALL                                      0  $3      
         13        SEND_VAR                                                 $3
         14        DO_ICALL                                         $4      
         15        SEND_VAR                                                 $4
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function pad_key:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
Branch analysis from position: 9
Branch analysis from position: 19
Branch analysis from position: 19
filename:       /in/kQNoA
function name:  pad_key
number of ops:  22
compiled vars:  !0 = $key, !1 = $sizes, !2 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        STRLEN                                           ~3      !0
          2        IS_SMALLER                                               32, ~3
          3      > JMPZ                                                     ~4, ->5
          4    > > RETURN                                                   <false>
    8     5    >   ASSIGN                                                   !1, <array>
   11     6      > FE_RESET_R                                       $6      !1, ->19
          7    > > FE_FETCH_R                                               $6, !2, ->19
   12     8    > > JMP                                                      ->11
          9    >   CONCAT                                           ~7      !0, '%00'
         10        ASSIGN                                                   !0, ~7
         11    >   STRLEN                                           ~9      !0
         12        IS_SMALLER                                               ~9, !2
         13      > JMPNZ                                                    ~10, ->9
   13    14    >   STRLEN                                           ~11     !0
         15        IS_EQUAL                                                 !2, ~11
         16      > JMPZ                                                     ~12, ->18
         17    > > JMP                                                      ->19
   11    18    > > JMP                                                      ->7
         19    >   FE_FREE                                                  $6
   17    20      > RETURN                                                   !0
   18    21*     > RETURN                                                   null

End of function pad_key

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.52 ms | 1402 KiB | 18 Q