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);

preferences:
57.36 ms | 402 KiB | 5 Q