3v4l.org

run code in 300+ PHP versions simultaneously
<?php $secret = 'a0a7e7997b6d5fcd55f4b5c32611b87c'; function encrypt128($str, $secret) { $block = 16; $pad = $block - (strlen($str) % $block); $str .= str_repeat(chr($pad), $pad); return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $secret, $str, MCRYPT_MODE_ECB)); } function sslEncrypt128($str, $secret) { return base64_encode(openssl_encrypt($str, 'aes-128-ecb', $secret, OPENSSL_RAW_DATA)); } var_dump(encrypt128('small1', $secret)); var_dump(sslEncrypt128('small1', $secret));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v2J2N
function name:  (null)
number of ops:  16
compiled vars:  !0 = $secret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a0a7e7997b6d5fcd55f4b5c32611b87c'
   19     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'encrypt128'
          3        SEND_VAL                                                 'small1'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
   20     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'sslencrypt128'
         10        SEND_VAL                                                 'small1'
         11        SEND_VAR                                                 !0
         12        DO_FCALL                                      0  $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function encrypt128:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v2J2N
function name:  encrypt128
number of ops:  28
compiled vars:  !0 = $str, !1 = $secret, !2 = $block, !3 = $pad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ASSIGN                                                   !2, 16
    8     3        STRLEN                                           ~5      !0
          4        MOD                                              ~6      ~5, !2
          5        SUB                                              ~7      !2, ~6
          6        ASSIGN                                                   !3, ~7
    9     7        INIT_FCALL                                               'str_repeat'
          8        INIT_FCALL                                               'chr'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $9      
         11        SEND_VAR                                                 $9
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $10     
         14        ASSIGN_OP                                     8          !0, $10
   11    15        INIT_FCALL                                               'base64_encode'
         16        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
         17        FETCH_CONSTANT                                   ~12     'MCRYPT_RIJNDAEL_128'
         18        SEND_VAL_EX                                              ~12
         19        SEND_VAR_EX                                              !1
         20        SEND_VAR_EX                                              !0
         21        FETCH_CONSTANT                                   ~13     'MCRYPT_MODE_ECB'
         22        SEND_VAL_EX                                              ~13
         23        DO_FCALL                                      0  $14     
         24        SEND_VAR                                                 $14
         25        DO_ICALL                                         $15     
         26      > RETURN                                                   $15
   12    27*     > RETURN                                                   null

End of function encrypt128

Function sslencrypt128:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v2J2N
function name:  sslEncrypt128
number of ops:  14
compiled vars:  !0 = $str, !1 = $secret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_FCALL                                               'base64_encode'
          3        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAL_EX                                              'aes-128-ecb'
          6        SEND_VAR_EX                                              !1
          7        FETCH_CONSTANT                                   ~2      'OPENSSL_RAW_DATA'
          8        SEND_VAL_EX                                              ~2
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                         $4      
         12      > RETURN                                                   $4
   17    13*     > RETURN                                                   null

End of function sslencrypt128

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.02 ms | 1470 KiB | 19 Q