3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MySQLDao { var $dbhost = null; var $dbuser = null; var $dbpass = null; var $conn = null; var $dbname = null; var $result = null; function __construct() { $this->dbhost = Conn::$dbhost; $this->dbuser = Conn::$dbuser; $this->dbpass = Conn::$dbpass; $this->dbname = Conn::$dbname; } public function openConnection() { $this->conn = new mysqli($this->dbhost, $this->dbuser, $this->dbpass, $this->dbname); if (mysqli_connect_errno()) echo new Exception("Could not establish connection with database"); } public function getConnection() { return $this->conn; } public function closeConnection() { if ($this->conn != null) $this->conn->close(); } public function getUserDetails($Facebookid) { $returnValue = array(); $sql = "select * from Users where FacebookId='" . $Facebookid . "'"; $result = $this->conn->query($sql); if ($result != null && (mysqli_num_rows($result) >= 1)) { $row = $result->fetch_array(MYSQLI_ASSOC); if (!empty($row)) { $returnValue = $row; } } return $returnValue; } /* public function getUserDetailsWithPassword($email, $userPassword) { $returnValue = array(); $sql = "select id,user_email from users where user_email='" . $email . "' and user_password='" .$userPassword . "'"; $result = $this->conn->query($sql); if ($result != null && (mysqli_num_rows($result) >= 1)) { $row = $result->fetch_array(MYSQLI_ASSOC); if (!empty($row)) { $returnValue = $row; } } return $returnValue; } */ public function registerUser($Facebookid, $firstname, $lastname, $FBpictureURL, $Gender, $UserEmail) { $sql = "insert into Users FacebookId=?, firstname=?, lastname=?, FBpictureURL=?, Gender=?, UserEmail=?"; $statement = $this->conn->prepare($sql); if (!$statement) throw new Exception($statement->error); $statement->bind_param("isssss", $Facebookid, $firstname, $lastname, $FBpictureURL, $Gender, $UserEmail); $returnValue = $statement->execute(); return $returnValue; } } ?> Register.php <?php require("Conn.php"); require("MySQLDao.php"); $Facebookid = htmlentities($_POST["Facebookid"]); $firstname = htmlentities($_POST["firstname"]); $lastname = htmlentities($_POST["lastname"]); $FBPictureURL = htmlentities($_POST["FBPictureURL"]); $Gender = htmlentities($_POST["Gender"]); $UserEmail = htmlentities($_POST["UserEmail"]); $returnValue = array(); $dao = new MySQLDao(); $dao->openConnection(); $userDetails = $dao->getUserDetails($email); if(!empty($userDetails)) { $returnValue["status"] = "Success"; $returnValue["message"] = "User already exists, so Login"; $returnValue["userid"] = "Test"; $returnValue["firstname"] = "Test"; $returnValue["Gender"] = "Test"; $returnValue["FBPictureURL"] = "Test"; echo json_encode($returnValue); return; } $result = $dao->registerUser($Facebookid, $firstname, $lastname, $FBPictureURL, $Gender, $UserEmail); if($result) { $returnValue["status"] = "Success"; $returnValue["message"] = "New User is registered, so Login"; $returnValue["userid"] = "Test"; $returnValue["firstname"] = "Test"; $returnValue["Gender"] = "Test"; $returnValue["FBPictureURL"] = "Test"; echo json_encode($returnValue); return; } $dao->closeConnection(); ?>

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.3.60.0120.00316.86
8.3.50.0100.01221.15
8.3.40.0110.00418.66
8.3.30.0040.01519.26
8.3.20.0000.00820.30
8.3.10.0070.00023.48
8.3.00.0040.00719.24
8.2.180.0090.00918.41
8.2.170.0140.00319.08
8.2.160.0100.00722.96
8.2.150.0030.00624.18
8.2.140.0000.00924.66
8.2.130.0030.00526.16
8.2.120.0090.00021.18
8.2.110.0070.00321.09
8.2.100.0060.00617.72
8.2.90.0030.00617.97
8.2.80.0080.00017.97
8.2.70.0090.00017.63
8.2.60.0030.00617.91
8.2.50.0030.00618.07
8.2.40.0070.00018.16
8.2.30.0080.00418.01
8.2.20.0030.00617.81
8.2.10.0070.00018.08
8.2.00.0040.00418.09
8.1.280.0070.01325.92
8.1.270.0030.00620.37
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0070.00720.88
8.1.230.0060.00621.16
8.1.220.0080.00017.78
8.1.210.0000.00818.85
8.1.200.0000.01017.47
8.1.190.0080.00017.53
8.1.180.0000.00820.31
8.1.170.0000.00818.71
8.1.160.0000.00722.31
8.1.150.0000.00818.64
8.1.140.0040.00417.38
8.1.130.0040.00417.83
8.1.120.0040.00417.49
8.1.110.0050.00317.52
8.1.100.0050.00217.46
8.1.90.0000.00717.43
8.1.80.0040.00417.50
8.1.70.0080.00017.51
8.1.60.0040.00417.67
8.1.50.0040.00817.61
8.1.40.0060.00317.47
8.1.30.0050.00317.56
8.1.20.0040.00417.57
8.1.10.0050.00317.63
8.1.00.0000.00817.50
8.0.300.0070.00020.15
8.0.290.0080.00017.00
8.0.280.0070.00018.61
8.0.270.0040.00417.27
8.0.260.0030.00317.40
8.0.250.0070.00017.05
8.0.240.0040.00417.11
8.0.230.0030.00417.15
8.0.220.0030.00317.04
8.0.210.0070.00017.05
8.0.200.0030.00317.09
8.0.190.0040.00417.11
8.0.180.0040.00417.13
8.0.170.0040.00417.10
8.0.160.0050.00317.04
8.0.150.0040.00416.99
8.0.140.0070.00016.93
8.0.130.0000.00613.53
8.0.120.0060.00317.08
8.0.110.0000.00717.14
8.0.100.0040.00417.09
8.0.90.0000.00717.13
8.0.80.0110.00417.03
8.0.70.0000.00816.96
8.0.60.0000.00716.91
8.0.50.0040.00417.12
8.0.30.0110.00817.07
8.0.20.0140.00617.40
8.0.10.0000.00717.13
8.0.00.0120.00916.80
7.4.330.0000.00515.03
7.4.320.0000.00716.69
7.4.300.0000.00616.65
7.4.290.0070.00216.68
7.4.280.0040.00416.63
7.4.270.0040.00416.48
7.4.260.0070.00016.58
7.4.250.0040.00416.64
7.4.240.0070.00116.71
7.4.230.0070.00016.56
7.4.220.0180.00016.68
7.4.210.0060.00816.71
7.4.200.0050.00216.79
7.4.160.0100.00716.54
7.4.150.0180.00317.40
7.4.140.0080.01417.86
7.4.130.0110.01116.46
7.4.120.0090.01016.65
7.4.110.0120.00916.59
7.4.100.0160.00316.63
7.4.90.0170.00016.50
7.4.80.0140.00719.39
7.4.70.0120.00816.68
7.4.60.0100.00616.61
7.4.50.0000.00816.31
7.4.40.0080.00816.54
7.4.30.0090.00916.50
7.4.00.0120.00315.13
7.3.330.0020.00213.19
7.3.320.0060.00013.36
7.3.310.0030.00316.29
7.3.300.0070.00016.23
7.3.290.0000.00716.38
7.3.280.0050.01516.38
7.3.270.0150.00917.40
7.3.260.0180.00416.42
7.3.250.0050.01216.38
7.3.240.0130.00716.45
7.3.230.0060.01216.55
7.3.210.0130.00816.42
7.3.200.0100.00719.39
7.3.190.0110.01116.41
7.3.180.0110.00516.41
7.3.170.0140.00716.41
7.3.160.0060.01016.54
7.2.330.0110.00716.52
7.2.320.0060.01716.50
7.2.310.0080.00816.70
7.2.300.0130.00316.55
7.2.290.0120.00616.57
7.2.110.0210.01016.23
7.2.60.0070.01016.91
7.1.200.0100.00515.08
7.1.70.0030.00716.73
7.1.60.0120.00019.86
7.1.50.0070.01516.67
7.1.00.0000.08022.41
7.0.200.0070.00316.54
7.0.90.0300.05319.98
7.0.80.0430.05019.96
7.0.70.0630.07719.95
7.0.60.0370.06319.90
7.0.50.0570.07320.34
7.0.40.0100.07720.13
7.0.30.0100.08720.13
7.0.20.0030.07320.08
7.0.10.0170.03019.98
7.0.00.0030.07720.05
5.6.280.0030.07320.92
5.6.230.0100.08020.71
5.6.220.0170.07020.52
5.6.210.0070.05320.65
5.6.200.0070.06321.14
5.6.190.0100.05721.14
5.6.180.0130.03721.07
5.6.170.0070.08021.17
5.6.160.0300.04320.96
5.6.150.0200.07321.05
5.6.140.0130.07020.98
5.6.130.0030.08021.13
5.6.120.0000.07021.16
5.6.110.0130.04020.96
5.6.100.0170.07021.12
5.6.90.0070.05021.04
5.6.80.0030.04320.41
5.6.70.0130.07320.43
5.6.60.0100.07720.53
5.6.50.0130.05020.43
5.6.40.0070.08720.40
5.6.30.0130.07320.42
5.6.20.0000.06720.34
5.6.10.0070.06020.34
5.6.00.0030.05320.54
5.5.370.0070.04020.45
5.5.360.0100.06020.44
5.5.350.0070.07720.43
5.5.340.0070.05020.89
5.5.330.0130.08320.79
5.5.320.0100.07720.86
5.5.310.0170.07020.79
5.5.300.0030.08720.80
5.5.290.0170.06720.91
5.5.280.0100.08320.85
5.5.270.0000.09020.86
5.5.260.0130.08320.89
5.5.250.0200.07320.77
5.5.240.0070.07720.29
5.5.230.0100.08020.14
5.5.220.0130.05020.16
5.5.210.0030.06320.23
5.5.200.0030.05320.27
5.5.190.0100.07720.30
5.5.180.0170.06320.29
5.5.160.0030.05020.31
5.5.150.0030.04320.14
5.5.140.0030.06020.14
5.5.130.0030.05320.13
5.5.120.0070.04320.20
5.5.110.0030.04020.25
5.5.100.0070.04020.04
5.5.90.0030.04020.18
5.5.80.0030.04320.05
5.5.70.0070.04720.19
5.5.60.0030.03320.09
5.5.50.0070.04020.07
5.5.40.0030.06020.18
5.5.30.0000.04320.12
5.5.20.0030.04019.93
5.5.10.0000.04020.06
5.5.00.0030.03719.99
5.4.450.0130.04319.49
5.4.440.0030.04719.54
5.4.430.0100.05319.56
5.4.420.0100.07319.46
5.4.410.0000.07019.13
5.4.400.0200.06018.86
5.4.390.0300.06019.18
5.4.380.0100.05719.24
5.4.370.0130.07019.14
5.4.360.0130.07019.10
5.4.350.0100.06318.93
5.4.340.0200.07018.86
5.4.320.0030.04718.88
5.4.310.0000.04718.91
5.4.300.0170.02719.10
5.4.290.0070.03718.93
5.4.280.0030.04318.91
5.4.270.0030.04019.09
5.4.260.0070.03319.09
5.4.250.0000.04719.09
5.4.240.0070.03719.12
5.4.230.0000.04019.18
5.4.220.0070.04019.04
5.4.210.0100.03719.13
5.4.200.0100.03319.03
5.4.190.0070.07319.04
5.4.180.0030.03718.95
5.4.170.0030.03719.09
5.4.160.0000.04018.93
5.4.150.0070.03319.12
5.4.140.0000.03316.23
5.4.130.0000.03316.21
5.4.120.0070.02716.38
5.4.110.0070.03316.53
5.4.100.0030.03016.47
5.4.90.0000.04016.54
5.4.80.0030.03016.55
5.4.70.0000.04316.34
5.4.60.0070.03716.25
5.4.50.0070.06016.35
5.4.40.0070.03016.45
5.4.30.0000.04016.47
5.4.20.0070.03716.46
5.4.10.0000.04016.27
5.4.00.0070.03015.91
5.3.290.0070.05714.80
5.3.280.0070.07714.67
5.3.270.0000.04014.71
5.3.260.0030.03714.64
5.3.250.0070.03314.61
5.3.240.0000.04014.61
5.3.230.0000.04014.71
5.3.220.0000.03714.68
5.3.210.0030.03714.66
5.3.200.0000.03314.63
5.3.190.0030.04014.67
5.3.180.0000.04014.58
5.3.170.0000.04014.54
5.3.160.0030.03714.58
5.3.150.0030.07014.67
5.3.140.0070.04714.73
5.3.130.0000.03714.74
5.3.120.0130.03314.52
5.3.110.0070.03314.64
5.3.100.0030.04714.05
5.3.90.0030.04013.98
5.3.80.0000.04013.99
5.3.70.0070.03313.95
5.3.60.0000.07013.98
5.3.50.0100.05714.04
5.3.40.0030.05013.89
5.3.30.0100.03013.96
5.3.20.0030.03313.79
5.3.10.0030.04313.71
5.3.00.0030.03313.74
5.2.170.0000.03311.08
5.2.160.0030.03011.21
5.2.150.0030.02311.25
5.2.140.0030.03011.10
5.2.130.0030.02711.14
5.2.120.0000.03711.29
5.2.110.0030.02711.26
5.2.100.0030.03011.04
5.2.90.0000.03011.23
5.2.80.0000.03011.03
5.2.70.0030.03011.23
5.2.60.0100.06311.00
5.2.50.0200.04710.96
5.2.40.0030.04711.09
5.2.30.0100.05311.16
5.2.20.0070.04010.91
5.2.10.0100.05710.84
5.2.00.0070.06310.89
5.1.60.0100.06010.04
5.1.50.0070.04710.10
5.1.40.0030.0579.88
5.1.30.0030.05010.37
5.1.20.0030.05710.31
5.1.10.0070.05310.13
5.1.00.0030.06010.11
5.0.50.0070.0478.70
5.0.40.0030.0508.30
5.0.30.0100.0578.34
5.0.20.0000.0478.28
5.0.10.0030.0338.34
5.0.00.0000.0678.31
4.4.90.0030.0237.65
4.4.80.0000.0307.65
4.4.70.0000.0277.65
4.4.60.0030.0277.65
4.4.50.0070.0337.65
4.4.40.0070.0477.65
4.4.30.0030.0337.65
4.4.20.0030.0207.65
4.4.10.0070.0337.65
4.4.00.0130.0437.65
4.3.110.0100.0237.65
4.3.100.0070.0307.65
4.3.90.0070.0307.65
4.3.80.0030.0507.65
4.3.70.0000.0377.65
4.3.60.0000.0237.65
4.3.50.0070.0337.65
4.3.40.0070.0437.65
4.3.30.0030.0337.65
4.3.20.0030.0377.65
4.3.10.0100.0307.65
4.3.00.0000.0307.65

preferences:
50.48 ms | 401 KiB | 5 Q