3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decrypt ($str) { if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%',$str)) { $str = base64_decode($str); if ($str != "" && $str != null && $str != false) { $decStr = ""; for ($i=0; $i < strlen($str); $i+=3) { $array[$i/3] = substr($str,$i,3); } foreach($array as $s) { $a = $s^192; $decStr .= chr($a); } return $decStr; } return false; } return false; } echo decrypt("MTI5MTY0MTczMTY5MTc0"); ?> <?php function encrypt($str) { if(preg_match('%[a-zA-Z0-9/+]*={0,2}$%',$str)) { $str=base64_encode($str); if($str != "" && $str != null && $str != false) { $encStr=""; for($i=0;$i<strlen($str);$i+=1) { $a=$s^64; $encStr .=chr('MT'); $encStr .=chr($s); } return $encStr; } return false; } return false; } echo encrypt("Admin"); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Admin Warning: Undefined variable $s in /in/8NK2c on line 44 Fatal error: Uncaught TypeError: chr(): Argument #1 ($codepoint) must be of type int, string given in /in/8NK2c:45 Stack trace: #0 /in/8NK2c(45): chr('MT') #1 /in/8NK2c(55): encrypt('QWRtaW4=') #2 {main} thrown in /in/8NK2c on line 45
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:
42.09 ms | 401 KiB | 8 Q