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 git.master, git.master_jit, rfc.property-hooks
<!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>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.49 ms | 405 KiB | 8 Q