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)) { 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 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Admin Fatal error: Uncaught TypeError: Unsupported operand types: string ^ int in /in/ReQtu:44 Stack trace: #0 /in/ReQtu(57): encrypt('Admin') #1 {main} thrown in /in/ReQtu on line 44
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33
Admin @@@@@@@@@@@@@@@AUABQAFAAUABQA==

preferences:
350.59 ms | 404 KiB | 460 Q