3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo openssl_get_cipher_methods(); $textToEncrypt = "hello"; $encryptionMethod = "aes-256-cbc"; $secretHash = "123455"; $iv = "123456789012"; $encryptedMessage = openssl_encrypt($textToEncrypt, $encryptionMethod, $secretHash, 0, $iv); $decryptedMessage = openssl_decrypt($encryptedMessage, $encryptionMethod, $secretHash, 0, $iv); echo openssl_get_cipher_methods;
based on 7jF97
Output for 7.0.30, 7.1.17 - 7.3.0beta1
Fatal error: Uncaught Error: Call to undefined function openssl_get_cipher_methods() in /in/AiuEW:2 Stack trace: #0 {main} thrown in /in/AiuEW on line 2
Process exited with code 255.
Output for 5.6.30, 7.1.0 - 7.1.16
Notice: Array to string conversion in /in/AiuEW on line 2 Array Warning: openssl_encrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/AiuEW on line 7 Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/AiuEW on line 8 Notice: Use of undefined constant openssl_get_cipher_methods - assumed 'openssl_get_cipher_methods' in /in/AiuEW on line 9 openssl_get_cipher_methods
Output for hhvm-3.22.0
Notice: Array to string conversion in /in/AiuEW on line -1 Array Warning: IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/AiuEW on line -1 Warning: IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/AiuEW on line -1 Notice: Use of undefined constant openssl_get_cipher_methods - assumed 'openssl_get_cipher_methods' in /in/AiuEW on line -1 openssl_get_cipher_methods
Output for hhvm-3.18.5 - 3.21.3
Notice: Array to string conversion in /in/AiuEW on line 2 Array Warning: IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/AiuEW on line 7 Warning: IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /in/AiuEW on line 8 Notice: Use of undefined constant openssl_get_cipher_methods - assumed 'openssl_get_cipher_methods' in /in/AiuEW on line 9 openssl_get_cipher_methods