3v4l.org

run code in 200+ 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)) { $str=base64_encode($str); if($str != "" && $str != null && $str != false) { $encStr=""; for($i=0;$i<strlen($str);$+=1) $a=$s^64; $encStr .=chr('MT'); $encStr .=chr($s); } return $encStr; } return false; } return false; } echo encrypt("Admin"); ?>
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '+=' (T_PLUS_EQUAL), expecting variable (T_VARIABLE) or '$' in /in/FCjIo on line 42
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.27
Parse error: syntax error, unexpected T_PLUS_EQUAL, expecting T_VARIABLE or '$' in /in/FCjIo on line 42
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_PLUS_EQUAL, expecting T_VARIABLE or '$' in /in/FCjIo on line 42
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/FCjIo on line 42
Process exited with code 255.
Output for 4.3.0
Parse error: parse error, unexpected T_PLUS_EQUAL, expecting T_VARIABLE or '$' in /in/sXH9f on line 42
Process exited with code 255.