3v4l.org

run code in 300+ PHP versions simultaneously
<?php //require_once('./blowfish.php'); //$myfile = fopen("serial.txt", "r") or die("Unable to open file!"); $data='14700902370|0006|Renato Tarabella|renato@tarabella.it|||||'; $iv = '00000000'; // Show not be used anyway. $key = "0123456789ABCDEFF0E1D2C3B4A59687"; $encrypted=mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $data, MCRYPT_MODE_CBC, $iv); $hex=str2hex($encrypted); //fclose($myfile); echo $hex; function crypted($plainText){ $cipher = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_ECB, ''); $iv = 'FEDCBA9876543210'; // Show not be used anyway. $key = "0123456789ABCDEFF0E1D2C3B4A59687"; $cipherText = ""; if (mcrypt_generic_init($cipher, $key, $iv) != -1) { $cipherText = mcrypt_generic($cipher, $plainText); mcrypt_generic_deinit($cipher); } echo str2hex($cipherText); } function str2hex($func_string) { $func_retVal = ''; $func_length = strlen($func_string); for($func_index = 0; $func_index < $func_length; ++$func_index) $func_retVal .= ((($c = dechex(ord($func_string{$func_index}))) && strlen($c) & 2) ? $c : "0{$c}"); return strtoupper($func_retVal); } function String2Hex($string){ $hex=''; for ($i=0; $i < strlen($string); $i++){ $hex .= dechex(ord($string[$i])); } return $hex; } function Hex2String($hex){ $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2){ $string .= chr(hexdec($hex[$i].$hex[$i+1])); } return $string; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/bVTEG on line 32
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: Array and string offset access syntax with curly braces is no longer supported in /in/bVTEG on line 32
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/bVTEG on line 32 Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/bVTEG:7 Stack trace: #0 {main} thrown in /in/bVTEG on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/bVTEG:7 Stack trace: #0 {main} thrown in /in/bVTEG on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Call to undefined function mcrypt_encrypt() in /in/bVTEG on line 7
Process exited with code 255.

preferences:
228.45 ms | 401 KiB | 290 Q