3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); ini_set('display_errors', 1); session_start(); $crcTable = NULL; function make64int($high,$low) { return ($high<<32) | $low; } function right_shift($value) { $sign = (1<<63) & $value; return ($value >> 1) ^ $sign; } function makeCRCTable() { global $crcTable; $crcTable = array(); for ($n = 0; $n < 0x100; $n++) { $c = $n; for($k = 0; $k < 16; $k++) { $c = ($c&1 ? make64int(0xC96C5795,0xD7870F42) ^ right_shift($c) : right_shift($c)); } $crcTable[$n] = $c; } } function checkCRC($data) { global $crcTable; if ( $crcTable == NULL ) makeCRCTable(); $crc = make64int(0xFFFFFFFF,0xFFFFFFFF); for($i=0; $i<strlen($data); $i++) { $crc = (($crc << 8) ^ $crcTable[($crc ^ ord($data[$i])) & 0xFF])&make64int(0xFFFFFFFF,0xFFFFFFFF); } return $crc ^ make64int(0xFFFFFFFF,0xFFFFFFFF); } if($_SERVER["REQUEST_METHOD"] == "POST") { $myusername=urldecode($_POST['username']); $mypassword=urldecode($_POST['password']); if( $myusername == 'admin' and checkCRC($mypassword) == make64int(0xDF3EB920,0xCBBCB200) ) { $_SESSION['loggedin'] = true; header("Location: index.php"); exit(); } else { echo 'Invalid Login/Password<br>'; } } ?> <form action="" method="post"> <label>UserName :</label> <input type="text" name="username" value="admin"/><br /> message.html(make64int(0xDF3EB920,0xCBBCB200).Tostring()) <label>Password :</label> <input type="password" name="password" maxlength="8"/><br /> <input type="submit" value="Submit"/><br /><br /> </form> <a href=login.php.txt>view source</a>
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Notice: Undefined index: REQUEST_METHOD in /in/HfSlh on line 55 <form action="" method="post"> <label>UserName :</label> <input type="text" name="username" value="admin"/><br /> message.html(make64int(0xDF3EB920,0xCBBCB200).Tostring()) <label>Password :</label> <input type="password" name="password" maxlength="8"/><br /> <input type="submit" value="Submit"/><br /><br /> </form> <a href=login.php.txt>view source</a>