3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$argv = array(null, "' OR 1=1--", 'root'); $argv = array(null, "root", 'secret'); echo "<!doctype html>\n"; $username = @$_GET['username'] ? $_GET['username'] : $argv[1]; $password = @$_GET['password'] ? $_GET['password'] : $argv[2]; $password = md5($password); $pdo = new PDO('sqlite::memory:'); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $pdo->exec("DROP TABLE IF EXISTS users"); $pdo->exec("CREATE TABLE users (username VARCHAR(255), password VARCHAR(255))"); $rootPassword = md5("secret"); $pdo->exec("INSERT INTO users (username, password) VALUES ('root', '$rootPassword');"); echo $q = "SELECT * FROM users WHERE username = ? AND password = ?"; $statement = $pdo->prepare($q); $statement->execute(array($username, $password)); if (count($statement->fetchAll())) { echo "<br>\nAccess granted to $username!<br>\n"; } else { echo "<br>\nAccess denied for $username!<br>\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
<!doctype html> SELECT * FROM users WHERE username = ? AND password = ?<br> Access granted to root!<br>

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:
50.19 ms | 401 KiB | 8 Q