3v4l.org

run code in 300+ PHP versions simultaneously
<?php const ENC_METHOD = 'aes-256-ctr'; const ENC_SALT = "87CD2488-180D-442B-A68A-0307DC0CAB4D"; function B2R_Encrypt($message, $key) { $key = hash("sha256", ENC_SALT + $key, FALSE); //$key = hash("sha256", ENC_SALT + $key, TRUE); echo $key; $nonceSize = openssl_cipher_iv_length(ENC_METHOD); $nonce = openssl_random_pseudo_bytes($nonceSize); $ciphertext = openssl_encrypt( $message, ENC_METHOD, $key, OPENSSL_RAW_DATA, $nonce ); $result = base64_encode($nonce.$ciphertext); echo "\r\n"; return $result; } $ToEncrypt = 'Some test string'; $encrypted = B2R_Encrypt($ToEncrypt, ''); echo $encrypted;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: A non-numeric value encountered in /in/VbhHL on line 8 Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /in/VbhHL:8 Stack trace: #0 /in/VbhHL(32): B2R_Encrypt('Some test strin...', '') #1 {main} thrown in /in/VbhHL on line 8
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
154.38 ms | 406 KiB | 5 Q