3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 'On'); include 'storedinfo.php'; $server = "oniddb.cws.oregonstate.edu"; $username = "mcaliste-db"; $database = "mcaliste-db"; $mysqli = new mysqli($server, $username, $password, $database); if (!$mysqli || $mysqli->connect_errno) { echo "Connection error " .$mysqli->connect_errno ." ".$mysqli->connect_error; } else { echo "Connection successful<br>"; } // table name and attributes: // CREATE TABLE userinfo (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, // gender VARCHAR(6) NOT NULL, age INT NOT NULL, PRIMARY KEY (id) ); if(!empty($_POST)){ $name = htmlspecialchars($_POST['name']); $gender = htmlspecialchars($_POST['sex']); $age = htmlspecialchars($_POST['age']); } //$name = 'Bob'; //$gender = 'male'; //$age = 45; if (!($stmt = $mysqli->prepare("INSERT INTO userinfo(name, gender, age) VALUES (?, ?, ?)"))) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } $stmt->bind_param("ssi", $name, $gender, $age); $stmt->execute(); $stmt->close(); // remember to $stmt->close(); //$stmt->bind_result($resultName, $resultGender, $resultAge) //Select queries return a result set //if ($result = $mysqli->query("SELECT age FROM userinfo LIMIT 10")) { //printf("Select returned %d rows.\n", $result->num_rows); //free result set //$result->close(); //} ?>

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.70.0140.00318.43
8.3.60.0120.00318.43
8.3.50.0140.00816.55
8.3.40.0060.00818.88
8.3.30.0040.01118.80
8.3.20.0000.00918.96
8.3.10.0050.00318.82
8.3.00.0000.00819.50
8.2.180.0100.01017.00
8.2.170.0030.01022.96
8.2.160.0000.01819.04
8.2.150.0040.00424.18
8.2.140.0070.00324.66
8.2.130.0040.00426.16
8.2.120.0090.00620.88
8.2.110.0140.00422.20
8.2.100.0040.01117.99
8.2.90.0030.00519.22
8.2.80.0080.00017.97
8.2.70.0080.00017.46
8.2.60.0000.00817.92
8.2.50.0000.00817.91
8.2.40.0000.00819.36
8.2.30.0030.00617.82
8.2.20.0050.00517.75
8.2.10.0080.00017.92
8.2.00.0060.00217.89
8.1.280.0000.01425.92
8.1.270.0050.00323.99
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0030.00623.92
8.1.230.0080.00417.95
8.1.220.0030.00517.91
8.1.210.0000.00818.77
8.1.200.0000.00917.60
8.1.190.0040.00417.48
8.1.180.0000.00818.10
8.1.170.0050.00317.62
8.1.160.0040.00419.08
8.1.150.0000.00818.62
8.1.140.0040.00417.43
8.1.130.0000.00717.43
8.1.120.0040.00417.52
8.1.110.0000.00817.47
8.1.100.0040.00417.54
8.1.90.0030.00517.51
8.1.80.0070.00017.51
8.1.70.0000.00717.54
8.1.60.0000.00717.72
8.1.50.0060.00317.64
8.1.40.0000.00817.58
8.1.30.0050.00317.71
8.1.20.0030.00617.71
8.1.10.0060.00317.64
8.1.00.0040.00417.62
8.0.300.0020.00518.77
8.0.290.0000.00716.75
8.0.280.0040.00418.63
8.0.270.0000.00717.39
8.0.260.0040.00416.95
8.0.250.0000.00717.20
8.0.240.0080.00017.18
8.0.230.0030.00617.21
8.0.220.0000.00717.15
8.0.210.0070.00017.11
8.0.200.0000.00617.09
8.0.190.0050.00217.09
8.0.180.0040.00417.09
8.0.170.0040.00417.13
8.0.160.0030.00317.08
8.0.150.0030.00517.11
8.0.140.0040.00417.04
8.0.130.0030.00313.53
8.0.120.0030.00717.01
8.0.110.0000.00716.98
8.0.100.0040.00417.15
8.0.90.0040.00416.91
8.0.80.0060.00917.04
8.0.70.0000.00817.04
8.0.60.0030.00617.00
8.0.50.0040.00416.98
8.0.30.0120.00617.02
8.0.20.0140.00517.35
8.0.10.0000.00717.19
8.0.00.0130.00516.89
7.4.330.0050.00013.04
7.4.320.0030.00316.68
7.4.300.0000.00616.66
7.4.290.0000.00816.54
7.4.280.0020.00516.69
7.4.270.0050.00616.68
7.4.260.0000.00613.43
7.4.250.0000.00716.55
7.4.240.0030.00416.53
7.4.230.0030.00316.69
7.4.220.0110.00816.63
7.4.210.0070.01016.62
7.4.200.0070.00416.39
7.4.190.0050.00316.83
7.4.160.0100.00616.52
7.4.150.0120.00616.65
7.4.140.0110.01517.86
7.4.130.0160.00716.63
7.4.120.0200.00316.68
7.4.110.0120.00816.80
7.4.100.0030.01516.76
7.4.90.0090.00916.54
7.4.80.0100.00719.39
7.4.70.0140.00416.57
7.4.60.0040.01516.47
7.4.50.0050.00016.39
7.4.40.0070.00716.63
7.4.30.0150.00616.55
7.4.00.0060.00914.85
7.3.330.0060.00013.22
7.3.320.0020.00513.11
7.3.310.0030.00316.47
7.3.300.0070.00016.41
7.3.290.0080.00916.37
7.3.280.0060.00916.38
7.3.270.0150.00416.43
7.3.260.0100.00716.37
7.3.240.0110.00716.37
7.3.230.0080.00816.45
7.3.210.0000.01616.37
7.3.200.0080.00816.67
7.3.190.0120.00516.34
7.3.180.0050.01116.41
7.3.170.0100.00716.56
7.3.160.0060.01516.59
7.3.120.0000.01614.77
7.2.330.0140.00816.60
7.2.320.0070.01116.61
7.2.310.0070.01316.52
7.2.300.0110.00616.62
7.2.290.0100.00716.60
7.2.60.0880.01015.13
7.2.00.0090.00319.11
7.1.200.0030.00715.58
7.1.100.0030.00718.25
7.1.70.0000.00817.09
7.1.60.0060.01619.25
7.1.50.0100.01416.68
7.1.00.0070.04022.32
7.0.200.0000.00816.59
7.0.140.0030.07321.96
7.0.120.0070.04022.16
7.0.60.0070.07321.75
7.0.50.0030.07717.83
7.0.40.0070.08320.00
7.0.30.0300.08020.10
7.0.20.0200.04020.31
7.0.10.0070.09020.21
7.0.00.0100.04020.17
5.6.280.0030.07320.93
5.6.210.0130.07320.77
5.6.200.0100.07718.16
5.6.190.0070.04020.50
5.6.180.0370.03720.68
5.6.170.0300.08020.39
5.6.160.0130.04320.52
5.6.150.0100.07318.13
5.6.140.0100.08318.16
5.6.130.0100.08018.15
5.6.120.0070.05320.97
5.6.110.0070.05021.03
5.6.100.0070.08321.13
5.6.90.0000.09321.00
5.6.80.0070.08020.51
5.5.350.0270.08020.39
5.5.340.0130.07317.89
5.5.330.0100.07020.37
5.5.320.0130.08320.29
5.5.310.0330.07020.42
5.5.300.0100.07317.99
5.5.290.0070.03717.96
5.5.280.0070.07720.74
5.5.270.0170.05320.85
5.5.260.0300.07020.84
5.5.250.0000.04320.62
5.5.240.0000.08020.16
5.4.450.4370.04319.27
5.4.440.3700.03719.50
5.4.430.3770.04019.41
5.4.420.3800.03719.21
5.4.410.3830.05019.09
5.4.400.3930.03719.21
5.4.390.4230.04319.15
5.4.380.3600.04019.27
5.4.370.3770.04019.17
5.4.360.3570.04019.05
5.4.350.3630.03318.88
5.4.340.0100.06719.14
5.4.320.4170.04719.17
5.4.310.4270.03719.07
5.4.300.4270.04019.11
5.4.290.3730.03319.09
5.4.280.4170.03718.89
5.4.270.3400.03319.06
5.4.260.3570.03719.13
5.4.250.3830.03719.17
5.4.240.4030.03319.17
5.4.230.4400.03019.05
5.4.220.3700.04019.17
5.4.210.3800.04319.26
5.4.200.4070.04319.16
5.4.190.4000.03718.93
5.4.180.3900.04319.16
5.4.170.4670.04718.96
5.4.160.4070.04018.98
5.4.150.3430.03718.88
5.4.140.4630.03016.23
5.4.130.3800.03716.14
5.4.120.3870.03716.36
5.4.110.3830.03316.34
5.4.100.3370.03316.50
5.4.90.3830.03716.36
5.4.80.3770.03016.37
5.4.70.3930.03716.57
5.4.60.3530.04016.15
5.4.50.3700.03716.14
5.4.40.4130.03316.30
5.4.30.3930.04016.36
5.4.20.3970.05316.14
5.4.10.4730.04716.44
5.4.00.4400.03015.74
5.3.290.4500.03714.58
5.3.280.4500.04314.55
5.3.270.4170.03714.58
5.3.260.4100.03714.56
5.3.250.3900.03314.55
5.3.240.3600.04014.56
5.3.230.3830.04314.49
5.3.220.3730.04014.51
5.3.210.3500.04014.46
5.3.200.3830.03714.50
5.3.190.3570.03714.56
5.3.180.4000.03714.55
5.3.170.3700.03014.48
5.3.160.3770.04014.54
5.3.150.3530.03714.54
5.3.140.3470.04014.50
5.3.130.3830.03314.49
5.3.120.3900.04014.45
5.3.110.3730.04014.50
5.3.100.3930.03313.98
5.3.90.3770.03313.96
5.3.80.4630.03313.96
5.3.70.4000.04013.96
5.3.60.4630.04714.04
5.3.50.4630.03713.89
5.3.40.4100.04013.80
5.3.30.4030.03013.71
5.3.20.4030.04013.80
5.3.10.3570.03713.60
5.3.00.4530.03713.58
5.2.170.3870.03011.25
5.2.160.3730.02311.25
5.2.150.3330.01711.09
5.2.140.3330.03311.13
5.2.130.3000.02710.95
5.2.120.3070.02711.27
5.2.110.3400.03311.11
5.2.100.3900.03011.00
5.2.90.3970.03311.00
5.2.80.3570.03011.04
5.2.70.3200.03011.04
5.2.60.3700.02311.00
5.2.50.3800.03310.97
5.2.40.3000.02710.84
5.2.30.2830.03011.00
5.2.20.3230.03010.92
5.2.10.3230.02710.74
5.2.00.3230.02710.74
5.1.60.3130.01710.16
5.1.50.2670.03010.16
5.1.40.2400.02310.06
5.1.30.2530.02310.39
5.1.20.2400.02710.32
5.1.10.2170.02310.10
5.1.00.2100.0239.93
5.0.50.1270.0178.71
5.0.40.1170.0208.48
5.0.30.1170.0338.25
5.0.20.1200.0208.28
5.0.10.1230.0208.19
5.0.00.1200.0278.13
4.4.90.1530.0175.86
4.4.80.1700.0135.86
4.4.70.1300.0105.86
4.4.60.1770.0135.86
4.4.50.1800.0135.86
4.4.40.1470.0305.86
4.4.30.1400.0175.86
4.4.20.1200.0175.89
4.4.10.1170.0175.92
4.4.00.0930.0205.86
4.3.110.1270.0175.86
4.3.100.1170.0175.86
4.3.90.1200.0175.88
4.3.80.1200.0235.89
4.3.70.0970.0175.90
4.3.60.1200.0175.90
4.3.50.1200.0135.90
4.3.40.1270.0235.90
4.3.30.0330.0135.90
4.3.20.0600.0175.90
4.3.10.0600.0205.91
4.3.00.0600.0175.91

preferences:
44.86 ms | 401 KiB | 5 Q