3v4l.org

run code in 300+ PHP versions simultaneously
<?php include_once"ui/connectdb.php"; session_start(); // License check function $licenseKey = "1fde8ca4875c8f65b47a3ad8c54f8c372e4125fcd4398ce6065a48161af5ef3f"; // Replace with your actual license key $systemIdentifier = gethostname(); // Or use another method to get a unique system identifier $expirationDate = "2026-03-21"; // Set your expiration date $currentDate = time(); $expirationTimestamp = strtotime($expirationDate); $remainingDays = ceil(($expirationTimestamp - $currentDate) / (60 * 60 * 24)); // Display Remaining Days echo "<p>Days remaining for license expiration: $remainingDays</p>"; // Call the license check at the beginning of the script $select = $pdo->prepare("SELECT * FROM tbl_user LIMIT 1"); $select->execute(); $row = $select->fetch(PDO::FETCH_ASSOC); if (!$row) { // No user found, display a message and redirect to registration page $_SESSION['status'] = "No user found for this app,Register an account as Admin to continue."; $_SESSION['status_code'] = "warning"; header("Location: ui/registration.php"); exit(); } if(isset($_POST["btn_login"])) { $useremail = $_POST["txt_email"]; $password= $_POST["txt_password"]; $select = $pdo->prepare("select * from tbl_user where useremail='$useremail' and userpassword='$password'"); $select->execute(); $row = $select->fetch(PDO::FETCH_ASSOC); if(is_array($row)){ if ($licenseKey !== hash('sha256', $systemIdentifier)) { if ($licenseKey !== hash('sha256', $systemIdentifier)) { // License key is invalid $_SESSION['status'] = "License key is invalid for this system."; $_SESSION['status_code'] = "error"; } // Check if the current date is before the expiration date if (strtotime($expirationDate) < time()) { // License is expired $_SESSION['status'] = "License has expired. Please renew or contact support."; $_SESSION['status_code'] = "error"; } } elseif($row['useremail']==$useremail AND $row['userpassword']==$password and $row['role']=="Admin"){ $_SESSION['status']="login successfull By Admin"; $_SESSION['status_code']="success"; header('refresh: 1; ui/dashboard.php'); $_SESSION['userid']=$row['userid']; $_SESSION['username'] = $row['username']; $_SESSION['useremail'] = $row['useremail']; $_SESSION['role'] = $row['role']; } elseif($row['useremail']==$useremail AND $row['userpassword']==$password and $row['role']=="User"){ $_SESSION['status']="login successfull By User"; $_SESSION['status_code']="success"; header('refresh: 1; ui/user.php'); $_SESSION['userid']=$row['userid']; $_SESSION['username'] = $row['username']; $_SESSION['useremail'] = $row['useremail']; $_SESSION['role'] = $row['role']; } }else{ $_SESSION['status']="Wrong Email or password"; $_SESSION['status_code']="error"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>STORE | Log in</title> <!-- Google Font: Source Sans Pro --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback"> <!-- Font Awesome --> <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css"> <!-- icheck bootstrap --> <!-- <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css"> --> <!-- Theme style --> <!-- SweetAlert2 --> <link rel="stylesheet" href="plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css"> <!-- Toastr --> <link rel="stylesheet" href="plugins/toastr/toastr.min.css"> <link rel="stylesheet" href="dist/css/adminlte.min.css"> </head> <body class="hold-transition login-page"> <div class="login-box"> <!-- /.login-logo --> <div class="card card-outline card-primary"> <div class="card-header text-center"> <a href="index.php" class="h1"><b>STORE</b> <br></a> <h2>T.M OKI VENTURE</h2> </div> <div class="card-body"> <p class="login-box-msg">Sign in to start your session</p> <form action="" method="post"> <div class="input-group mb-3"> <input type="email" class="form-control" placeholder="Email" name="txt_email" required> <div class="input-group-append"> <div class="input-group-text"> <span class="fas fa-envelope"></span> </div> </div> </div> <div class="input-group mb-3"> <input type="password" class="form-control" placeholder="Password" name="txt_password" required> <div class="input-group-append"> <div class="input-group-text"> <span class="fas fa-lock"></span> </div> </div> </div> <div class="row"> <div class="col-8"> <div class="icheck-primary"> <!-- <a href="ui/changepassword.php">Forgot Password</a> --> </div> </div> <!-- /.col --> <div class="col-4"> <button type="submit" class="btn btn-primary btn-block" name="btn_login" >Log In</button> </div> <!-- /.col --> </div> </form> <!-- /.social-auth-links --> <p class="mb-1"> </p> <p class="mb-0"> </p> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.login-box --> </body> </html> <!-- jQuery --> <script src="plugins/jquery/jquery.min.js"></script> <!-- Bootstrap 4 --> <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- SweetAlert2 --> <script src="plugins/sweetalert2/sweetalert2.min.js"></script> <!-- Toastr --> <script src="plugins/toastr/toastr.min.js"></script> <!-- AdminLTE App --> <script src="dist/js/adminlte.min.js"></script> <?php if(isset($_SESSION['status']) && $_SESSION['status']!='') { ?> <script> $(function() { var Toast = Swal.mixin({ toast: true, position: 'top', showConfirmButton: false, timer: 5000 }); Toast.fire({ icon: '<?php echo $_SESSION['status_code'];?>', title: '<?php echo $_SESSION['status'];?>' }) }); </script> <?php unset($_SESSION['status']); } ?>

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)
8.4.70.0290.01118.70
8.4.60.0240.01118.00
8.4.50.0270.00718.02
8.4.40.0280.00918.05
8.4.30.0180.00418.17
8.4.20.0220.00218.16
8.4.10.0150.00617.85
8.3.210.0040.00417.04
8.3.200.0180.00316.88
8.3.190.0170.00216.87
8.3.180.0280.01116.66
8.3.170.0270.00916.75
8.3.160.0240.00916.70
8.3.150.0310.00216.84
8.3.140.0220.00516.76
8.3.130.0250.00616.68
8.3.120.0150.00417.08
8.3.110.0170.00116.90
8.3.100.0190.00216.78
8.3.90.0150.00416.79
8.3.80.0170.00216.77
8.3.70.0170.00416.61
8.3.60.0160.00417.14
8.3.50.0200.00316.49
8.3.40.0150.00417.97
8.3.30.0150.00317.69
8.3.20.0160.00217.61
8.3.10.0150.00317.95
8.3.00.0160.00717.94
8.2.280.0160.00217.09
8.2.270.0170.00317.09
8.2.260.0180.00516.97
8.2.250.0120.00517.18
8.2.240.0110.00716.89
8.2.230.0140.00316.77
8.2.220.0120.00416.93
8.2.210.0150.00216.61
8.2.200.0130.00416.96
8.2.190.0130.00416.52
8.2.180.0140.00316.42
8.2.170.0180.00318.07
8.2.160.0140.00717.81
8.2.150.0150.00417.86
8.2.140.0140.00617.82
8.2.130.0170.00817.90
8.2.120.0240.00517.84
8.2.110.0140.00517.94
8.2.100.0160.00817.72
8.2.90.0130.00517.75
8.2.80.0140.00418.10
8.2.70.0140.00417.77
8.2.60.0150.00417.86
8.2.50.0130.00917.84
8.2.40.0140.00617.82
8.2.30.0160.00617.68
8.2.20.0110.00517.87
8.2.10.0220.00617.94
8.2.00.0230.01017.47

preferences:
45.24 ms | 403 KiB | 5 Q