3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $key = hash('sha256', 'spottycats', true); var_dump(bin2hex($key)); $cipher = openssl_encrypt( 'Yes, it totally does.', 'aes-128-ctr', $key, OPENSSL_RAW_DATA, str_repeat("\x00", 16) ); $hmac = hash_hmac( 'sha256', $cipher, hash('sha256', 'spottycats', true), true ); echo base64_encode($cipher . $hmac), PHP_EOL;
based on JBkGE
Output for 7.1.20 - 7.3.0rc3
string(64) "27ba61131ac180b9c03e439dd81bc536f63b30b6009000688292f17cc086da61" Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in /in/VC0uS:5 Stack trace: #0 {main} thrown in /in/VC0uS on line 5
Process exited with code 255.
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.1.11
string(64) "27ba61131ac180b9c03e439dd81bc536f63b30b6009000688292f17cc086da61" wGVEtlgIETc4E4SNly0b7viJAv3bpO/85lC5/XCssVnMlrPc+TxeI+Jrsl+wVwQVOKbCEw8=