3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = 'your data to be encrypted'; $key = 'secret passphrase to encrypt'; $cipher = "MCRYPT_SERPENT_256"; $mode = "MCRYPT_MODE_CBC"; function m_encrypt($data, $key, $cipher, $mode){ return (string) base64_encode( mcrypt_encrypt( $cipher, substr(md5($key),0,mcrypt_get_key_size($cipher, $mode)), $data, $mode, substr(md5($key),0,mcrypt_get_block_size($cipher, $mode)) ) ); } function m_decrypt($data, $key, $cipher, $mode){ return (string) mcrypt_decrypt( $cipher, substr(md5($key),0,mcrypt_get_key_size($cipher, $mode)), base64_decode($data), $mode, substr(md5($key),0,mcrypt_get_block_size($cipher, $mode)) ); } echo m_encrypt($data, $key, $cipher, $mode) ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/A8esC:10 Stack trace: #0 /in/A8esC(31): m_encrypt('your data to be...', 'secret passphra...', 'MCRYPT_SERPENT_...', 'MCRYPT_MODE_CBC') #1 {main} thrown in /in/A8esC on line 10
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:
35.71 ms | 401 KiB | 8 Q