3v4l.org

run code in 300+ PHP versions simultaneously
<?php //set up the database connection $servername = "192.129.1.209"; $username = "meaadmin"; $password = "Kasten_15&"; $dbname = "typo3mea"; $dataurl = "http://127.0.0.1:8000/api/thesis?format=json"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } //read the json file content $jsondata = file_get_contents($dataurl); //convert json object to php array $data = json_decode($jsondata, true); echo file_get_contents($dataurl); if (empty($data)) { echo "empty"; } $b = count($data); echo $b; //insert into mysql table foreach($data->objects as $obj) { $sql = "INSERT INTO mea_thesis(title) VALUES('".$obj->title."')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } } echo "test"; $conn->close(); echo file_get_contents("http://google.com"); //echo phpinfo(); ?>

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.00916.50
8.3.50.0130.00521.09
8.3.40.0070.00718.71
8.3.30.0070.00718.78
8.3.20.0000.00920.30
8.3.10.0080.00023.61
8.3.00.0060.00322.51
8.2.180.0120.00316.88
8.2.170.0090.00622.96
8.2.160.0100.00322.20
8.2.150.0150.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0060.00317.50
8.2.110.0060.00320.47
8.2.100.0060.00617.75
8.2.90.0040.00419.22
8.2.80.0040.00417.97
8.2.70.0030.00617.25
8.2.60.0000.00917.93
8.2.50.0030.00518.07
8.2.40.0000.00820.84
8.2.30.0040.00419.78
8.2.20.0040.00417.61
8.2.10.0000.00718.08
8.2.00.0050.00217.95
8.1.280.0060.00825.92
8.1.270.0050.00320.38
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0070.00323.98
8.1.230.0080.00317.42
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0090.00017.35
8.1.190.0050.00317.23
8.1.180.0000.00718.10
8.1.170.0040.00418.61
8.1.160.0000.00721.88
8.1.150.0000.00818.71
8.1.140.0020.00517.40
8.1.130.0030.00317.71
8.1.120.0000.00717.41
8.1.110.0000.00717.25
8.1.100.0000.00717.30
8.1.90.0030.00317.26
8.1.80.0050.00217.41
8.1.70.0000.00717.39
8.1.60.0000.00917.57
8.1.50.0030.00517.46
8.1.40.0000.00817.50
8.1.30.0040.00417.69
8.1.20.0000.00717.62
8.1.10.0070.00017.61
8.1.00.0080.00017.50
8.0.300.0040.00418.77
8.0.290.0080.00016.75
8.0.280.0050.00318.39
8.0.270.0030.00317.20
8.0.260.0040.00417.25
8.0.250.0000.00717.02
8.0.240.0040.00416.84
8.0.230.0000.00716.89
8.0.220.0030.00516.77
8.0.210.0000.00716.89
8.0.200.0000.00616.98
8.0.190.0070.00316.84
8.0.180.0030.00716.87
8.0.170.0000.00916.99
8.0.160.0020.00517.00
8.0.150.0040.00416.80
8.0.140.0050.00316.88
8.0.130.0000.00813.35
8.0.120.0070.00016.87
8.0.110.0040.00416.97
8.0.100.0000.00716.86
8.0.90.0000.00716.78
8.0.80.0060.01016.91
8.0.70.0040.00416.80
8.0.60.0070.00016.86
8.0.50.0000.00816.71
8.0.30.0140.00717.07
8.0.20.0110.00717.40
8.0.10.0000.00716.92
8.0.00.0070.01016.75
7.4.330.0000.00515.14
7.4.320.0000.00616.56
7.4.300.0060.00016.47
7.4.290.0070.00016.51
7.4.280.0060.00316.61
7.4.270.0040.00416.54
7.4.260.0050.00216.48
7.4.250.0030.00416.51
7.4.240.0040.00416.51
7.4.230.0030.00316.36
7.4.220.0100.01716.69
7.4.210.0160.00016.63
7.4.200.0000.00716.63
7.4.160.0060.01016.53
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0090.01316.46
7.4.120.0070.01016.63
7.4.110.0120.00616.59
7.4.100.0060.01316.57
7.4.90.0130.00316.50
7.4.80.0110.01119.39
7.4.70.0200.00316.42
7.4.60.0090.00616.41
7.4.50.0000.00816.44
7.4.40.0040.01116.54
7.4.30.0060.01216.47
7.4.00.0070.01015.17
7.3.330.0070.00213.02
7.3.320.0030.00313.20
7.3.310.0070.00016.36
7.3.300.0000.00716.27
7.3.290.0070.00716.26
7.3.280.0060.01316.24
7.3.270.0090.00817.40
7.3.260.0060.01216.34
7.3.250.0100.00716.37
7.3.240.0060.01116.51
7.3.230.0060.01616.39
7.3.210.0030.01416.65
7.3.200.0200.00319.39
7.3.190.0090.00616.55
7.3.180.0030.01216.49
7.3.170.0030.01316.27
7.3.160.0090.00916.32
7.2.330.0110.00916.43
7.2.320.0090.00816.53
7.2.310.0030.01316.51
7.2.300.0030.01316.61
7.2.290.0100.01316.50
7.2.60.0040.01116.38
7.2.00.0030.00919.03
7.1.200.0060.00715.59
7.1.100.0030.00818.00
7.1.70.0070.00416.78
7.1.60.0100.01419.18
7.1.50.0130.01016.50
7.1.00.0100.07022.31
7.0.200.0030.00516.54
7.0.60.0030.04320.05
7.0.50.0100.06717.80
7.0.40.0070.06020.20
7.0.30.0430.08020.20
7.0.20.0230.08020.33
7.0.10.0100.08720.30
7.0.00.0130.06020.00
5.6.280.0000.07021.03
5.6.210.0070.06720.77
5.6.200.0070.07018.19
5.6.190.0030.07320.56
5.6.180.3400.05020.35
5.6.170.0370.05720.52
5.6.160.0130.05020.38
5.6.150.0070.07318.09
5.6.140.0100.07318.21
5.6.130.0000.09018.21
5.6.120.0070.06721.01
5.6.110.0070.08320.99
5.6.100.0100.07320.99
5.6.90.0030.04020.97
5.6.80.0100.08020.52
5.6.70.4700.04020.39
5.5.350.0100.04320.50
5.5.340.0070.07017.98
5.5.330.0070.03720.47
5.5.320.0330.07020.30
5.5.310.0130.06320.21
5.5.300.0130.07317.98
5.5.290.0100.06017.93
5.5.280.0100.06720.91
5.5.270.0030.06720.88
5.5.260.0100.08020.73
5.5.250.0000.04320.69
5.5.240.0130.06320.16
5.4.450.0770.06019.27
5.4.440.1030.07319.48
5.4.430.0770.08719.47
5.4.420.1030.07719.12
5.4.410.0870.08019.37
5.4.400.1030.07319.21
5.4.390.0670.06319.25
5.4.380.0930.05719.27
5.4.370.0700.06718.79
5.4.360.1000.06019.27
5.4.350.0800.04719.29
5.4.340.0730.06318.91
5.4.320.0800.06719.00
5.4.310.0830.06019.30
5.4.300.0700.05718.99
5.4.290.0800.06319.25
5.4.280.0800.04318.94
5.4.270.0730.04019.27
5.4.260.0770.05019.29
5.4.250.0830.05319.12
5.4.240.0830.05019.27
5.4.230.0830.05319.12
5.4.220.0730.05719.21
5.4.210.0870.05019.11
5.4.200.0830.05016.83
5.4.190.0700.05319.13
5.4.180.0670.06019.27
5.4.170.0730.06318.95
5.4.160.0800.05319.05
5.4.150.0830.06019.22
5.4.140.0800.05716.29
5.4.130.0730.06316.27
5.4.120.0770.06316.55
5.4.110.0630.05016.61
5.4.100.0830.05016.39
5.4.90.0900.05716.55
5.4.80.0530.06316.17
5.4.70.0700.06316.16
5.4.60.0230.04716.41
5.4.50.0030.05316.20
5.4.40.0530.04016.42
5.4.30.0330.06316.46
5.4.20.0100.04316.36

preferences:
92.87 ms | 401 KiB | 5 Q