3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function insecureEncryptDoNotUse(string $plaintext, string $key): string { return \bin2hex( \openssl_encrypt( $plaintext, 'aes-128-ecb', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING ) ); } $key = str_repeat("3.14", 4); var_dump(insecureEncryptDoNotUse('YELLOW SUBMARINE', $key)); var_dump(insecureEncryptDoNotUse('ORANGE SUBMARINE', $key)); var_dump(insecureEncryptDoNotUse('YELLOW SUBMARINE' . 'ORANGE SUBMARINE', $key));
based on uq1BY
Output for 7.1.20 - 7.2.6
Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in /in/t6TmH:6 Stack trace: #0 /in/t6TmH(17): insecureEncryptDoNotUse('YELLOW SUBMARIN...', '3.143.143.143.1...') #1 {main} thrown in /in/t6TmH on line 6
Process exited with code 255.
Output for hhvm-3.15.4, 7.0.0 - 7.1.7
string(32) "a62a2d80f4c99a2a8ce1361499c357d0" string(32) "f7bd100fa23b4513833f8a407b78f450" string(64) "a62a2d80f4c99a2a8ce1361499c357d0f7bd100fa23b4513833f8a407b78f450"
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/t6TmH on line 3
Process exited with code 255.