3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($texttocrypt, $ky, $iv) { // $ky = '5rrdv4lkjdshfkl43bgd'; // Key from file // $iv = ; try { $encrypted = ""; $length = strlen($texttocrypt); $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, ''); mcrypt_generic_init($cipher, $ky, $iv); $encrypted = base64_encode(mcrypt_generic($cipher, $texttocrypt)); mcrypt_generic_deinit($cipher); $result1 = bin2hex($iv); $result2 = bin2hex($encrypted); $result = $result1 . $result2; return $result; } catch (Exception $e) { $this->lastError = "Error while encrypting '".$texttocrypt."' - ".$e->getMessage(); throw new Exception($this->lastError); } } echo encrypt('sup#own#hnf#15', 'jhfjdjj%6s77w', '234ghyjdGtskjd&7d6sj6w6hfkjhvfDw20');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function mcrypt_module_open() in /in/NIqJH:11 Stack trace: #0 /in/NIqJH(25): encrypt('sup#own#hnf#15', 'jhfjdjj%6s77w', '234ghyjdGtskjd&...') #1 {main} thrown in /in/NIqJH on line 11
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:
41.06 ms | 401 KiB | 8 Q