3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hash = md5('test'); $s =encrypt_blowfish('123123123123', $hash); decrypt_blowfish($s, $hash); function decrypt_blowfish($data, $key) { $iv = pack("H*", substr($data, 0, 16)); $x = pack("H*", substr($data, 16)); while (strlen($iv) < mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC)) { $iv .= "\0"; } $res = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $x, MCRYPT_MODE_CBC, $iv); return $res; } function encrypt_blowfish($data, $key) { $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $crypttext = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $data, MCRYPT_MODE_CBC, $iv); return bin2hex($iv . $crypttext); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /in/2dfI1:17 Stack trace: #0 /in/2dfI1(3): encrypt_blowfish('123123123123', '098f6bcd4621d37...') #1 {main} thrown in /in/2dfI1 on line 17
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.95 ms | 401 KiB | 8 Q