3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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)) { if($str != "" && $str != null && $str != false) { $encStr=""; for($i=0;$i<strlen($str);$i+=1) { $a=$str[$i]^64; $encStr .=chr("1"); $encStr .=chr($a); echo $encStr; } $encStr=base64_encode($encStr); return $encStr; } return false; } return false; } echo encrypt("Admin"); ?>
Output for 7.1.0
Admin Warning: A non-numeric value encountered in /in/ReQtu on line 44 @ Warning: A non-numeric value encountered in /in/ReQtu on line 44 @@ Warning: A non-numeric value encountered in /in/ReQtu on line 44 @@@ Warning: A non-numeric value encountered in /in/ReQtu on line 44 @@@@ Warning: A non-numeric value encountered in /in/ReQtu on line 44 @@@@@AUABQAFAAUABQA==
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
Admin @@@@@@@@@@@@@@@AUABQAFAAUABQA==