3v4l.org

run code in 300+ PHP versions simultaneously
<?php function base16Encode($arg){ $ret = ''; for($i=0; $i < strlen($arg); $i++){ $tmp = ord(substr($arg, $i, 1)); $ret .= dechex($tmp); } return $ret; } function encode($text) { return bin2hex($text); } function decode($base16){ return pack("H*", $base16); } function encrypt($key, $link){ $cp = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', 'cbc', ''); @mcrypt_generic_init($cp, $key, $key); $enc = mcrypt_generic($cp, $link); mcrypt_generic_deinit($cp); mcrypt_module_close($cp); return $enc; } $key="KEY"; echo $transmitKey = base16Encode($key); echo '\r\n\r\n'; echo encode($transmitKey); $link="URL"; $crypted = base64_encode(encrypt($key, $link)); //echo $crypted;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 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
4b4559\r\n\r\n346234353539 Fatal error: Uncaught Error: Call to undefined function mcrypt_module_open() in /in/CNQOD:22 Stack trace: #0 /in/CNQOD(37): encrypt('KEY', 'URL') #1 {main} thrown in /in/CNQOD on line 22
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 4b4559\r\n\r\n346234353539 Fatal error: Uncaught Error: Call to undefined function mcrypt_module_open() in /in/CNQOD:22 Stack trace: #0 /in/CNQOD(37): encrypt('KEY', 'URL') #1 {main} thrown in /in/CNQOD on line 22
Process exited with code 255.

preferences:
132.01 ms | 402 KiB | 216 Q