3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = 'hello'; $key = 'test'; echo bin2hex(mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, '')); echo "\n"; echo bin2hex(mcrypt_decrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, '')); $encrypted = hex2bin('c6ea4b7d8f'); echo "\n"; echo mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $encrypted, MCRYPT_MODE_STREAM, ''); echo "\n"; echo mcrypt_decrypt(MCRYPT_ARCFOUR, $key, $encrypted, MCRYPT_MODE_STREAM, ''); /* --- using OpenSSL --- */ echo "\n"; echo bin2hex(openssl_encrypt($text, 'RC4', pack('H*', $key), OPENSSL_ZERO_PADDING | OPENSSL_RAW_DATA));
based on Y6DRS
Output for 7.0.6 - 7.3.1
Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/oc8cm:5 Stack trace: #0 {main} thrown in /in/oc8cm on line 5
Process exited with code 255.
Output for 5.5.0 - 5.5.34, 5.6.0 - 5.6.20, 7.0.0 - 7.0.5
c6ea4b7d8f c6ea4b7d8f hello hello Warning: pack(): Type H: illegal hex digit t in /in/oc8cm on line 17 Warning: pack(): Type H: illegal hex digit s in /in/oc8cm on line 17 Warning: pack(): Type H: illegal hex digit t in /in/oc8cm on line 17 92d06e2a5d
Output for 5.5.35, 5.6.21 - 5.6.28
Fatal error: Call to undefined function mcrypt_encrypt() in /in/oc8cm on line 5
Process exited with code 255.