3v4l.org

run code in 300+ PHP versions simultaneously
<?php $error = ''; if ($_POST) { if (empty($_POST['username']) || empty($_POST['password'])) { $error = "<span>Please fill the required fields</span>"; } $hashed_password = password_hash("disco313", PASSWORD_DEFAULT); //Connect to database $host = ""; $dbname = ""; $user = ""; $pass = ""; $charset = "UTF8MB4"; // if your db does not use CHARSET=UTF8MB4, you should probably be fixing that $dsn = "mysql:host={$host};dbname={$dbname};charset={$charset}"; $options = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, // highly recommended PDO::ATTR_EMULATE_PREPARES => false // ALWAYS! ALWAYS! ALWAYS! ]; $db = new PDO($dsn, $user, $pass, $options); $stmnt = $db->prepare( "SELECT * FROM register WHERE 'username' = :username AND 'password' = :password"); if ($stmt->execute($stmnt) ){ session_start(); header('Location: http://localhost/Scmr/php/Home.php'); } else { $error = "<span>Please enter the correct username and password</span>"; } } echo "└[∵]┐└[∵]┘┌[∵]┘└[∵]┐└[∵]┘┌[∵]┘" ; exit;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.3.50.0090.01114.85
7.3.40.0030.01014.52
7.3.30.0070.00714.46
7.3.20.0060.00916.50
7.3.10.0060.00816.57
7.3.00.0060.00916.47
7.2.180.0090.01215.20
7.2.170.0150.00014.85
7.2.160.0040.01014.79
7.2.150.0070.00716.81
7.2.140.0090.00516.78
7.2.130.0030.01116.90
7.2.120.0120.00316.85
7.2.110.0090.00616.70
7.2.100.0090.00616.71
7.2.90.0080.00716.98
7.2.80.0060.00916.92
7.2.70.0030.01216.52
7.2.60.0100.00317.07
7.2.50.0110.00016.81
7.2.40.0040.00716.94
7.2.30.0040.00716.96
7.2.20.0090.00316.80
7.2.10.0040.01116.79
7.2.00.0150.00616.88
7.1.280.0070.00715.58
7.1.270.0030.01015.32
7.1.260.0100.00315.58
7.1.250.0100.00315.45

preferences:
26.94 ms | 401 KiB | 5 Q