3v4l.org

run code in 300+ PHP versions simultaneously
<?php function aesEncrypt($str, $key) { return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, aesEncryptPad($str), MCRYPT_MODE_ECB); } function aesEncryptPad($str, $blockSize = 16) { $len = $blockSize - (strlen($str) % $blockSize); $padding = str_repeat(chr($len), $len); return $str . $padding; } var_dump(aesEncrypt('ROLL TIDE', 'pass'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ShdYF
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'aesencrypt'
          2        SEND_VAL                                                 'ROLL+TIDE'
          3        SEND_VAL                                                 'pass'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function aesencrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ShdYF
function name:  aesEncrypt
number of ops:  15
compiled vars:  !0 = $str, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
          3        FETCH_CONSTANT                                   ~2      'MCRYPT_RIJNDAEL_128'
          4        SEND_VAL_EX                                              ~2
          5        SEND_VAR_EX                                              !1
          6        INIT_FCALL_BY_NAME                                       'aesEncryptPad'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $3      
          9        SEND_VAR_NO_REF_EX                                       $3
         10        FETCH_CONSTANT                                   ~4      'MCRYPT_MODE_ECB'
         11        SEND_VAL_EX                                              ~4
         12        DO_FCALL                                      0  $5      
         13      > RETURN                                                   $5
    5    14*     > RETURN                                                   null

End of function aesencrypt

Function aesencryptpad:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ShdYF
function name:  aesEncryptPad
number of ops:  17
compiled vars:  !0 = $str, !1 = $blockSize, !2 = $len, !3 = $padding
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      16
    8     2        STRLEN                                           ~4      !0
          3        MOD                                              ~5      ~4, !1
          4        SUB                                              ~6      !1, ~5
          5        ASSIGN                                                   !2, ~6
    9     6        INIT_FCALL                                               'str_repeat'
          7        INIT_FCALL                                               'chr'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
   10    14        CONCAT                                           ~11     !0, !3
         15      > RETURN                                                   ~11
   11    16*     > RETURN                                                   null

End of function aesencryptpad

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.56 ms | 1394 KiB | 20 Q