3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt(string $plaintext, string $key): string { return \bin2hex( \openssl_encrypt( $plaintext, 'aes-128-ecb', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING ) ); } $key = random_bytes(32); var_dump(encrypt('YELLOW SUBMARINE', $key)); var_dump(encrypt('ORANGE SUBMARINE', $key)); var_dump(encrypt('YELLOW SUBMARINE' . 'ORANGE SUBMARINE', $key));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mCdt9
function name:  (null)
number of ops:  26
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'random_bytes'
          1        SEND_VAL                                                 32
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
   17     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'encrypt'
          6        SEND_VAL                                                 'YELLOW+SUBMARINE'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                                 
   18    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'encrypt'
         13        SEND_VAL                                                 'ORANGE+SUBMARINE'
         14        SEND_VAR                                                 !0
         15        DO_FCALL                                      0  $5      
         16        SEND_VAR                                                 $5
         17        DO_ICALL                                                 
   19    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'encrypt'
         20        SEND_VAL                                                 'YELLOW+SUBMARINEORANGE+SUBMARINE'
         21        SEND_VAR                                                 !0
         22        DO_FCALL                                      0  $7      
         23        SEND_VAR                                                 $7
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

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

End of function encrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.8 ms | 1403 KiB | 22 Q