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);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Undefined constant "OPENSSL_CIPHER_AES_256_CBC" in /in/v7rkp:5 Stack trace: #0 {main} thrown in /in/v7rkp on line 5
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Undefined constant "OPENSSL_CIPHER_AES_256_CBC" in /in/v7rkp:5 Stack trace: #0 {main} thrown in /in/v7rkp on line 5
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant OPENSSL_CIPHER_AES_256_CBC - assumed 'OPENSSL_CIPHER_AES_256_CBC' (this will throw an Error in a future version of PHP) in /in/v7rkp on line 5 Fatal error: Uncaught Error: Call to undefined function openssl_cipher_iv_length() in /in/v7rkp:7 Stack trace: #0 {main} thrown in /in/v7rkp on line 7
Process exited with code 255.
Output for 7.1.20 - 7.1.33
Notice: Use of undefined constant OPENSSL_CIPHER_AES_256_CBC - assumed 'OPENSSL_CIPHER_AES_256_CBC' in /in/v7rkp on line 5 Fatal error: Uncaught Error: Call to undefined function openssl_cipher_iv_length() in /in/v7rkp:7 Stack trace: #0 {main} thrown in /in/v7rkp on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.25, 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
Warning: openssl_cipher_iv_length(): Unknown cipher algorithm in /in/v7rkp on line 7 Warning: openssl_cipher_iv_length(): Unknown cipher algorithm in /in/v7rkp on line 10 string(1) "7" bool(false) bool(false)

preferences:
216.17 ms | 402 KiB | 227 Q