3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = hash('sha256', 'spottycats', true); var_dump(bin2hex($key)); $cipher = openssl_encrypt( 'Yes, it totally does.', 'aes-128-ctr', $key, OPENSSL_RAW_DATA, str_repeat("\x00", 16) ); $hmac = hash_hmac( 'sha256', $cipher, hash('sha256', 'spottycats', true), true ); echo base64_encode($cipher . $hmac), PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VC0uS
function name:  (null)
number of ops:  44
compiled vars:  !0 = $key, !1 = $cipher, !2 = $hmac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'hash'
          1        SEND_VAL                                                 'sha256'
          2        SEND_VAL                                                 'spottycats'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    4     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'bin2hex'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
    5    12        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
    6    13        SEND_VAL_EX                                              'Yes%2C+it+totally+does.'
    7    14        SEND_VAL_EX                                              'aes-128-ctr'
    6    15        SEND_VAR_EX                                              !0
    9    16        FETCH_CONSTANT                                   ~7      'OPENSSL_RAW_DATA'
         17        SEND_VAL_EX                                              ~7
   10    18        INIT_FCALL                                               'str_repeat'
         19        SEND_VAL                                                 '%00'
         20        SEND_VAL                                                 16
         21        DO_ICALL                                         $8      
         22        SEND_VAR_NO_REF_EX                                       $8
         23        DO_FCALL                                      0  $9      
    5    24        ASSIGN                                                   !1, $9
   12    25        INIT_FCALL                                               'hash_hmac'
   13    26        SEND_VAL                                                 'sha256'
   14    27        SEND_VAR                                                 !1
   15    28        INIT_FCALL                                               'hash'
         29        SEND_VAL                                                 'sha256'
         30        SEND_VAL                                                 'spottycats'
         31        SEND_VAL                                                 <true>
         32        DO_ICALL                                         $11     
         33        SEND_VAR                                                 $11
   16    34        SEND_VAL                                                 <true>
         35        DO_ICALL                                         $12     
   12    36        ASSIGN                                                   !2, $12
   19    37        INIT_FCALL                                               'base64_encode'
         38        CONCAT                                           ~14     !1, !2
         39        SEND_VAL                                                 ~14
         40        DO_ICALL                                         $15     
         41        ECHO                                                     $15
         42        ECHO                                                     '%0A'
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.37 ms | 1396 KiB | 25 Q