3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sSecretKey = 'TrueID2015tRUEid'; $json = json_encode($input); $encrypt = fnEncrypt($json, $sSecretKey); function fnEncrypt($sValue, $sSecretKey) { $iv = base64_decode('Jc8EZ9nZPbWZEoV4ad8/CQ=='); $sValue = pkcs5_pad($sValue, mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); $sValue = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sSecretKey, $sValue, MCRYPT_MODE_CBC, $iv); $sValue = base64_encode($sValue); return $sValue; } function pkcs5_pad($text, $blocksize) { $pad = $blocksize - (strlen($text) % $blocksize); $pad2 = $text . str_repeat(chr($pad), $pad); return $pad2; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $input in /in/M0c7N on line 3 Fatal error: Uncaught Error: Call to undefined function mcrypt_get_block_size() in /in/M0c7N:8 Stack trace: #0 /in/M0c7N(4): fnEncrypt('null', 'TrueID2015tRUEi...') #1 {main} thrown in /in/M0c7N 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:
44.58 ms | 401 KiB | 8 Q