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|OPENSSL_ZERO_PADDING, $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.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 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: Call to undefined function openssl_encrypt() in /in/Ip8qN:6 Stack trace: #0 {main} thrown in /in/Ip8qN on line 6
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: Call to undefined function openssl_encrypt() in /in/Ip8qN:6 Stack trace: #0 {main} thrown in /in/Ip8qN 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/Ip8qN:7 Stack trace: #0 {main} thrown in /in/Ip8qN on line 7
Process exited with code 255.

preferences:
192.02 ms | 402 KiB | 188 Q