3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function encrypt(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(encrypt('YELLOW SUBMARINE', $key)); var_dump(encrypt('ORANGE SUBMARINE', $key)); var_dump(encrypt('YELLOW SUBMARINE' . 'ORANGE SUBMARINE', $key));
based on mCdt9
Output for hhvm-3.15.4, 7.0.0 - 7.2.0
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/uq1BY on line 3
Process exited with code 255.