3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo bin2hex( openssl_encrypt( /* Message: */ "The quick brown fox jumps over the lazy dog", /* Cipher algorithm and block mode: */ 'aes-128-ctr', /* Encryption key: (don't use weak keys like this ever, it's just an example!): */ "\x01\x02\x03\x04"."\x05\x06\x07\x08" . "\x09\x0a\x0b\x0c" . "\x0d\x0e\x0f\x10", /* Constant that means "don't encode": */ OPENSSL_RAW_DATA, /* Initialization Vector or Nonce -- don't ever actually use all NULL bytes: */ str_repeat("\0", 16) // This is a really bad way to generate a nonce or IV. // See how it's done here: http://stackoverflow.com/a/30189841/2224584 ) );
Output for 7.0.19 - 7.0.33, 7.1.5 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in /in/ih8om:4 Stack trace: #0 {main} thrown in /in/ih8om on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.18, 7.1.0 - 7.1.4
Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in /in/ih8om:3 Stack trace: #0 {main} thrown in /in/ih8om on line 3
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Fatal error: Call to undefined function openssl_encrypt() in /in/ih8om on line 4
Process exited with code 255.

preferences:
203.19 ms | 402 KiB | 392 Q