3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cipher = 'AES-256-CBC'; // $cipher = 'AES-256-CFB8'; $cipher = OPENSSL_CIPHER_AES_256_CBC; $mode = strtolower(substr($cipher, strrpos($cipher, '-') - strlen($cipher))); $ivSize = openssl_cipher_iv_length($cipher); $blockSize = $ivSize > 0 ? $ivSize : openssl_cipher_iv_length(str_ireplace('-' . $mode, '', $cipher)); var_dump($mode); var_dump($ivSize); var_dump($blockSize);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v7rkp
function name:  (null)
number of ops:  46
compiled vars:  !0 = $cipher, !1 = $mode, !2 = $ivSize, !3 = $blockSize
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'AES-256-CBC'
    5     1        FETCH_CONSTANT                                   ~5      'OPENSSL_CIPHER_AES_256_CBC'
          2        ASSIGN                                                   !0, ~5
    6     3        INIT_FCALL                                               'strtolower'
          4        INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        INIT_FCALL                                               'strrpos'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '-'
          9        DO_ICALL                                         $7      
         10        STRLEN                                           ~8      !0
         11        SUB                                              ~9      $7, ~8
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !1, $11
    7    17        INIT_FCALL_BY_NAME                                       'openssl_cipher_iv_length'
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0  $13     
         20        ASSIGN                                                   !2, $13
    8    21        IS_SMALLER                                               0, !2
         22      > JMPZ                                                     ~15, ->25
    9    23    >   QM_ASSIGN                                        ~16     !2
         24      > JMP                                                      ->35
   10    25    >   INIT_FCALL_BY_NAME                                       'openssl_cipher_iv_length'
         26        INIT_FCALL                                               'str_ireplace'
         27        CONCAT                                           ~17     '-', !1
         28        SEND_VAL                                                 ~17
         29        SEND_VAL                                                 ''
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $18     
         32        SEND_VAR_NO_REF_EX                                       $18
         33        DO_FCALL                                      0  $19     
         34        QM_ASSIGN                                        ~16     $19
    8    35    >   ASSIGN                                                   !3, ~16
   12    36        INIT_FCALL                                               'var_dump'
         37        SEND_VAR                                                 !1
         38        DO_ICALL                                                 
   13    39        INIT_FCALL                                               'var_dump'
         40        SEND_VAR                                                 !2
         41        DO_ICALL                                                 
   14    42        INIT_FCALL                                               'var_dump'
         43        SEND_VAR                                                 !3
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.33 ms | 1400 KiB | 23 Q