3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($string) { $output = false; $encrypt_method = "AES-256-CBC"; $secret_key = 'ExampleKey'; $secret_iv = 'ExampleIv'; // hash $key = hash('sha256', $secret_key); $iv = substr(hash('sha256', $secret_iv), 0, 16); $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv); $output = base64_encode($output); return $output; } echo encrypt("01234567890123").PHP_EOL; echo encrypt("012345678901234").PHP_EOL; echo encrypt("0123456789012345").PHP_EOL; echo encrypt("01234567890123456").PHP_EOL;
Output for rfc.property-hooks, git.master, git.master_jit
Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in /in/eIMMY:15 Stack trace: #0 /in/eIMMY(21): encrypt('01234567890123') #1 {main} thrown in /in/eIMMY on line 15
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:
55.39 ms | 1512 KiB | 4 Q