3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); $connect = new mysqli('localhost', 'username', 'password', 'db_name'); $connect->set_charset('utf8mb4'); // always set the charset if (isset($_POST['user_name'], $_POST['user_pass']) && $_POST['user_login'] == 1) { //Assigning posted values to variables. $username = $_POST['user_name']; $password = $_POST['user_pass']; //Checking the values are existing in the database or not $stmt = $connect->prepare("SELECT user_pass FROM users WHERE user_name=?"); $stmt->bind_param('s', $username); $stmt->execute(); $result = $stmt->get_result(); $user_from_db = $result->fetch_object(); if ($user_from_db && password_verify($password, $user_from_db->user_pass)) { $_SESSION['pageadmin'] = true; $_SESSION['user_name'] = $username; } else { //If the login credentials doesn't match, he will be shown with an error message. echo "Invalid Login Credentials."; } }
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
Fatal error: Uncaught Error: Call to undefined function mysqli_report() in /in/evQeq:5 Stack trace: #0 {main} thrown in /in/evQeq on line 5
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.

preferences:
187.15 ms | 407 KiB | 5 Q