3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key_arr = array(0x09, 0x76, 0x28, 0x34, 0x3f, 0xe9, 0x9e, 0x23, 0x76, 0x5c, 0x15, 0x13, 0xac, 0xcf, 0x8b, 0x02); $iv_arr = array(0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28, 0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58); $key = implode(array_map("chr", $key_arr)); $iv = implode(array_map("chr", $iv_arr)); $encryptedMessage = openssl_encrypt("openssl: hello", 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $iv); $decryptedMessage = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $encryptedMessage, MCRYPT_MODE_CBC, $iv); echo $decryptedMessage; echo "\n"; $encryptedMessage = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, "mcrypt: hello", MCRYPT_MODE_CBC, $iv); $decryptedMessage = openssl_decrypt($encryptedMessage, 'AES-128-CBC', $key, OPENSSL_RAW_DATA|OPENSSL_ZERO_PADDING, $iv); echo $decryptedMessage;
Output for 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in /in/8utiv:6 Stack trace: #0 {main} thrown in /in/8utiv on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.15, 7.2.0 - 7.2.3
Fatal error: Uncaught Error: Call to undefined function mcrypt_decrypt() in /in/8utiv:7 Stack trace: #0 {main} thrown in /in/8utiv on line 7
Process exited with code 255.

preferences:
162.87 ms | 401 KiB | 154 Q