3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = 'test'; $key = openssl_random_pseudo_bytes(16); $iv = openssl_random_pseudo_bytes(16); $cipher = mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $key, $message, MCRYPT_MODE_CBC, $iv ); $plain = openssl_decrypt( $cipher, 'aes-128-cbc', $key, OPENSSL_ZERO_PADDING, $iv ); var_dump( $message, bin2hex($cipher), $plain, mb_strlen($message, '8bit'), mb_strlen($plain, '8bit'), $message === $plain );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K6ZEU
function name:  (null)
number of ops:  49
compiled vars:  !0 = $message, !1 = $key, !2 = $iv, !3 = $cipher, !4 = $plain
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'test'
    3     1        INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
          2        SEND_VAL_EX                                              16
          3        DO_FCALL                                      0  $6      
          4        ASSIGN                                                   !1, $6
    4     5        INIT_FCALL_BY_NAME                                       'openssl_random_pseudo_bytes'
          6        SEND_VAL_EX                                              16
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
    6     9        INIT_FCALL_BY_NAME                                       'mcrypt_encrypt'
    7    10        FETCH_CONSTANT                                   ~10     'MCRYPT_RIJNDAEL_128'
         11        SEND_VAL_EX                                              ~10
         12        SEND_VAR_EX                                              !1
         13        SEND_VAR_EX                                              !0
   10    14        FETCH_CONSTANT                                   ~11     'MCRYPT_MODE_CBC'
         15        SEND_VAL_EX                                              ~11
    7    16        SEND_VAR_EX                                              !2
    6    17        DO_FCALL                                      0  $12     
         18        ASSIGN                                                   !3, $12
   14    19        INIT_FCALL_BY_NAME                                       'openssl_decrypt'
   15    20        SEND_VAR_EX                                              !3
   16    21        SEND_VAL_EX                                              'aes-128-cbc'
   15    22        SEND_VAR_EX                                              !1
   18    23        FETCH_CONSTANT                                   ~14     'OPENSSL_ZERO_PADDING'
         24        SEND_VAL_EX                                              ~14
   15    25        SEND_VAR_EX                                              !2
   14    26        DO_FCALL                                      0  $15     
         27        ASSIGN                                                   !4, $15
   22    28        INIT_FCALL                                               'var_dump'
   23    29        SEND_VAR                                                 !0
   24    30        INIT_FCALL                                               'bin2hex'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                         $17     
         33        SEND_VAR                                                 $17
   25    34        SEND_VAR                                                 !4
   26    35        INIT_FCALL                                               'mb_strlen'
         36        SEND_VAR                                                 !0
         37        SEND_VAL                                                 '8bit'
         38        DO_ICALL                                         $18     
         39        SEND_VAR                                                 $18
   27    40        INIT_FCALL                                               'mb_strlen'
         41        SEND_VAR                                                 !4
         42        SEND_VAL                                                 '8bit'
         43        DO_ICALL                                         $19     
         44        SEND_VAR                                                 $19
   28    45        IS_IDENTICAL                                     ~20     !0, !4
         46        SEND_VAL                                                 ~20
   22    47        DO_ICALL                                                 
   29    48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.62 ms | 1447 KiB | 17 Q