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('MT'); $encStr .=chr($a); } $encStr=base64_encode($encStr); return $encStr; } return false; } return false; } echo encrypt("Admin"); ?>
Output for 7.1.0
Admin Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Warning: A non-numeric value encountered in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Warning: A non-numeric value encountered in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Warning: A non-numeric value encountered in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Warning: A non-numeric value encountered in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Warning: A non-numeric value encountered in /in/f72YG on line 44 AEAAQABAAEAAQA==
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.0.14
Admin Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Warning: Illegal string offset 'i' in /in/f72YG on line 44 AEAAQABAAEAAQA==
Output for 4.3.0 - 5.3.29, hhvm-3.12.0
Admin Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 44 AEAAQABAAEAAQA==
Output for hhvm-3.10.0
Admin Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 19 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 19 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 19 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 19 Notice: Use of undefined constant i - assumed 'i' in /in/f72YG on line 19 AEAAQABAAEAAQA==