3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <?php function encode($string,$key) { $key = sha1($key); $strLen = strlen($string); $keyLen = strlen($key); for ($i = 0; $i < $strLen; $i++) { $ordStr = ord(substr($string,$i,1)); if ($j == $keyLen) { $j = 0; } $ordKey = ord(substr($key,$j,1)); $j++; $hash .= strrev(base_convert(dechex($ordStr + $ordKey),16,36)); } return $hash; } function decode($string,$key) { $key = sha1($key); $strLen = strlen($string); $keyLen = strlen($key); for ($i = 0; $i < $strLen; $i+=2) { $ordStr = hexdec(base_convert(strrev(substr($string,$i,2)),36,16)); if ($j == $keyLen) { $j = 0; } $ordKey = ord(substr($key,$j,1)); $j++; $hash .= chr($ordStr - $ordKey); } return $hash; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? echo htmlspecialchars($_GET["name"]) . '!'; ?></title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> <?php $name = htmlspecialchars($_GET['name']); $urlENC = encode( $name ,"whateverkey"); $urlDEC = decode( $urlENC ,"whateverkey"); echo htmlspecialchars($_GET["url"]) . ''; //echo htmlspecialchars($_POST['name']); //echo $urlENC; ?> <br /> <? echo $urlDEC; ?> </body>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? echo htmlspecialchars($_GET["name"]) . '!'; ?></title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> Warning: Undefined array key "name" in /in/PPMtN on line 62 Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /in/PPMtN on line 62 Warning: Undefined variable $hash in /in/PPMtN on line 27 Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/PPMtN on line 32 Warning: Undefined variable $hash in /in/PPMtN on line 41 Warning: Undefined array key "url" in /in/PPMtN on line 65 Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /in/PPMtN on line 65 <br /> <? echo $urlDEC; ?> </body>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? echo htmlspecialchars($_GET["name"]) . '!'; ?></title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> Warning: Undefined array key "name" in /in/PPMtN on line 62 Warning: Undefined variable $hash in /in/PPMtN on line 27 Warning: Undefined variable $hash in /in/PPMtN on line 41 Warning: Undefined array key "url" in /in/PPMtN on line 65 <br /> <? echo $urlDEC; ?> </body>
Output for 8.0.13
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Warning: Undefined array key "name" in /in/PPMtN on line 48 !</title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> Warning: Undefined array key "name" in /in/PPMtN on line 62 Warning: Undefined variable $hash in /in/PPMtN on line 27 Warning: Undefined variable $hash in /in/PPMtN on line 41 Warning: Undefined array key "url" in /in/PPMtN on line 65 <br /> </body>
Output for 5.4.0 - 5.4.45, 7.4.33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Notice: Undefined index: name in /in/PPMtN on line 48 !</title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> Notice: Undefined index: name in /in/PPMtN on line 62 Notice: Undefined variable: hash in /in/PPMtN on line 27 Notice: Undefined variable: hash in /in/PPMtN on line 41 Notice: Undefined index: url in /in/PPMtN on line 65 <br /> </body>
Output for 5.3.0 - 5.3.29, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? echo htmlspecialchars($_GET["name"]) . '!'; ?></title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> Notice: Undefined index: name in /in/PPMtN on line 62 Notice: Undefined variable: hash in /in/PPMtN on line 27 Notice: Undefined variable: hash in /in/PPMtN on line 41 Notice: Undefined index: url in /in/PPMtN on line 65 <br /> <? echo $urlDEC; ?> </body>
Output for 7.3.32 - 7.3.33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>!</title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> <br /> </body>
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? echo htmlspecialchars($_GET["name"]) . '!'; ?></title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> Notice: Undefined index: name in /in/PPMtN on line 62 Notice: Undefined variable: hash in /in/PPMtN on line 27 Notice: Undefined variable: hash in /in/PPMtN on line 41 Notice: Undefined index: url in /in/PPMtN on line 65 <br /> <? echo $urlDEC; ?> </body>
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/font-resize.js"></script> <script type="text/javascript"> $(document).ready(function() { fontResize(); $(window).bind('resize', function() { fontResize(); }); } ); </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? echo htmlspecialchars($_GET["name"]) . '!'; ?></title> <style type="text/css"> .BIG { font-size: 1050%; font-weight: bold; font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; text-align: center; } </style> </head> <body class="BIG"> Notice: Undefined index: name in /in/PPMtN on line 62 Notice: Undefined variable: hash in /in/PPMtN on line 27 Notice: Undefined variable: hash in /in/PPMtN on line 41 Notice: Undefined index: url in /in/PPMtN on line 65 <br /> <? echo $urlDEC; ?> </body>

preferences:
282.02 ms | 404 KiB | 460 Q