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 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="31323334353637383930393837363534"; echo $transmitKey = base16Encode($key); echo '\r\n\r\n'; echo base16Encode($transmitKey); $link="xxdd"; $crypted = base64_encode(encrypt($key, $link)); //echo $crypted;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 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
3331333233333334333533363337333833393330333933383337333633353334\r\n\r\n33333331333333323333333333333334333333353333333633333337333333383333333933333330333333393333333833333337333333363333333533333334 Fatal error: Uncaught Error: Call to undefined function mcrypt_module_open() in /in/f8Tbf:14 Stack trace: #0 /in/f8Tbf(29): encrypt('313233343536373...', 'xxdd') #1 {main} thrown in /in/f8Tbf on line 14
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 3331333233333334333533363337333833393330333933383337333633353334\r\n\r\n33333331333333323333333333333334333333353333333633333337333333383333333933333330333333393333333833333337333333363333333533333334 Fatal error: Uncaught Error: Call to undefined function mcrypt_module_open() in /in/f8Tbf:14 Stack trace: #0 /in/f8Tbf(29): encrypt('313233343536373...', 'xxdd') #1 {main} thrown in /in/f8Tbf on line 14
Process exited with code 255.

preferences:
237.12 ms | 402 KiB | 187 Q