3v4l.org

run code in 300+ PHP versions simultaneously
<?php function db_news_restart() { mysql_query("DROP TABLE IF EXISTS news"); mysql_query(" CREATE TABLE news ( id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, header longtext, text longtext, author longtext, lastedit longtext); "); } function db_news_create($header, $text, $author) { $set = array(); $set["header"] = "'" . mysql_real_escape_string($header) . "'"; $set["text"] = "'" . mysql_real_escape_string($text) . "'"; $set["author"] = "'" . mysql_real_escape_string($author) . "'"; $set["lastedit"] = "'" . time() . "'"; mysql_query("INSERT INTO news (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"); } function db_news_edit($id, $header, $text) { mysql_query("UPDATE news SET header = '" . mysql_real_escape_string($header) . "', text = '" . mysql_real_escape_string($text) . "' WHERE id = '" . mysql_real_escape_string($id) . "'") or die(mysql_error()); } function db_news_remove($id) { mysql_query("DELETE FROM news WHERE id = '" . mysql_real_escape_string($id) . "'") or die(mysql_error()); } function db_news_globalGET($id, $what) { $query = mysql_query("SELECT * FROM news WHERE id='" . mysql_real_escape_string($id) . "'"); $get = mysql_fetch_array($query, MYSQL_ASSOC); return $get[$what]; } function db_news_header($id) { return db_news_globalGET($id, "header"); } function db_news_text($id) { return db_news_globalGET($id, "text"); } function db_news_author($id) { return db_news_globalGET($id, "author"); } function db_news_lastedit($id) { return db_news_globalGET($id, "lastedit"); } ?>

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)
7.3.120.0060.00814.84
7.3.110.0030.01014.68
7.3.100.0070.00714.22
7.3.90.0070.00714.68
7.3.80.0000.01114.71
7.3.70.0040.00814.69
7.3.60.0050.00514.48
7.3.50.0060.00614.80
7.3.40.0060.01014.50
7.3.30.0040.00714.36
7.3.20.0110.00416.35
7.3.10.0100.00316.51
7.3.00.0060.00916.56
7.2.240.0000.01414.73
7.2.230.0060.01014.96
7.2.220.0110.00014.96
7.2.210.0070.00714.45
7.2.200.0040.00914.86
7.2.190.0040.01214.94
7.2.180.0030.01214.82
7.2.170.0070.01114.75
7.2.160.0040.01114.94
7.2.150.0030.00616.58
7.2.140.0030.01616.86
7.2.130.0030.01316.80
7.2.120.0060.00916.70
7.2.110.0120.00316.68
7.2.100.0110.00416.66
7.2.90.0030.01316.62
7.2.80.0030.01216.36
7.2.70.0070.00716.52
7.2.60.0150.00016.72
7.2.50.0070.01016.64
7.2.40.0040.01116.77
7.2.30.0000.01516.71
7.2.20.0060.00916.58
7.2.10.0100.00716.46
7.2.00.0080.00817.91
7.1.330.0060.00915.82
7.1.320.0080.00415.23
7.1.310.0030.00815.58
7.1.300.0000.01115.41
7.1.290.0040.00815.50
7.1.280.0070.01015.65
7.1.270.0060.00915.60
7.1.260.0080.00815.43
7.1.250.0030.00915.73
7.1.70.0030.00516.96
7.1.60.0060.01519.40
7.1.50.0040.00716.60
7.1.00.0000.06322.33
7.0.200.0000.00716.48
7.0.140.0070.07321.93
7.0.120.0000.07322.05
7.0.90.0200.06720.04
7.0.80.0070.05019.88
7.0.70.0170.07719.95
7.0.60.0070.03720.10
7.0.50.0070.04020.30
7.0.40.0000.06720.19
7.0.30.0030.04320.08
7.0.20.0030.04020.07
7.0.10.0070.03720.09
7.0.00.0100.03720.12
5.6.280.0030.07320.91
5.6.240.0030.07720.56
5.6.230.0000.05020.55
5.6.220.0100.08020.52
5.6.210.0070.03720.68
5.6.200.0100.04021.05
5.6.190.0000.04721.20
5.6.180.0000.04021.04
5.6.170.0000.04721.11
5.6.160.0100.05720.96
5.6.150.0100.03321.07
5.6.140.0130.07021.08
5.6.130.0200.06021.19
5.6.120.0030.06021.07
5.6.110.0030.03721.13
5.6.100.0070.08320.97
5.6.90.0100.04021.14
5.6.80.0030.04720.46
5.6.70.0070.03020.47
5.6.60.0070.03320.43
5.6.50.0030.04720.52
5.6.40.0000.04320.43
5.6.30.0000.04020.40
5.6.20.0070.03320.34
5.6.10.0000.04320.47
5.6.00.0000.03720.46
5.5.380.0130.07320.47
5.5.370.0000.07720.38
5.5.360.0070.04020.40
5.5.350.0000.04720.44
5.5.340.0130.03020.89
5.5.330.0000.04020.94
5.5.320.0030.03720.91
5.5.310.0070.03720.90
5.5.300.0030.03720.90
5.5.290.0130.05020.84
5.5.280.0030.08320.89
5.5.270.0100.04720.93
5.5.260.0070.03320.89
5.5.250.0070.04720.66
5.5.240.0070.05320.14
5.5.230.0070.03320.30
5.5.220.0030.03320.28
5.5.210.0000.04020.16
5.5.200.0000.04720.26
5.5.190.0130.03320.14
5.5.180.0030.04020.27
5.5.160.0000.04720.17
5.5.150.0030.04020.25
5.5.140.0070.03320.11
5.5.130.0030.04020.30
5.5.120.0030.03720.23
5.5.110.0070.03720.24
5.5.100.0030.04320.09
5.5.90.0070.04320.11
5.5.80.0100.06020.18
5.5.70.0000.04320.16
5.5.60.0030.07019.93
5.5.50.0030.06020.13
5.5.40.0200.06720.07
5.5.30.0030.04320.07
5.5.20.0030.08320.09
5.5.10.0200.06720.04
5.5.00.0030.06319.98
5.4.450.0070.04019.37
5.4.440.0070.04319.23
5.4.430.0030.06019.36
5.4.420.0030.03319.36
5.4.410.0030.04319.32
5.4.400.0030.03319.18
5.4.390.0000.03719.23
5.4.380.0030.03719.16
5.4.370.0000.04019.20
5.4.360.0070.03019.17
5.4.350.0000.04719.14
5.4.340.0030.08019.03
5.4.320.0030.04719.05
5.4.310.0000.04019.03
5.4.300.0000.03719.03
5.4.290.0070.03718.90
5.4.280.0030.03719.16
5.4.270.0000.04019.10
5.4.260.0100.03019.05
5.4.250.0000.03719.05
5.4.240.0030.04019.03
5.4.230.0070.03719.13
5.4.220.0030.03719.19
5.4.210.0030.07719.04
5.4.200.0100.07019.03
5.4.190.0030.08018.86
5.4.180.0070.06019.04
5.4.170.0000.07719.11
5.4.160.0030.04019.01
5.4.150.0070.07719.18
5.4.140.0070.06316.47
5.4.130.0100.06716.38
5.4.120.0030.06316.55
5.4.110.0030.06716.55
5.4.100.0130.06316.56
5.4.90.0100.06716.52
5.4.80.0030.07016.39
5.4.70.0100.05316.43
5.4.60.0000.04316.54
5.4.50.0030.04716.42
5.4.40.0030.07716.50
5.4.30.0000.06716.30
5.4.20.0000.05316.33
5.4.10.0000.07016.39
5.4.00.0100.06715.89
5.3.290.0000.05014.75
5.3.280.0030.05714.71
5.3.270.0070.04314.77
5.3.260.0100.03714.65
5.3.250.0030.04014.64
5.3.240.0070.07314.62
5.3.230.0030.07714.67
5.3.220.0100.06714.52
5.3.210.0100.05014.53
5.3.200.0070.07314.71
5.3.190.0100.07314.62
5.3.180.0070.07714.55
5.3.170.0100.07314.69
5.3.160.0000.08014.55
5.3.150.0130.07014.67
5.3.140.0100.08014.63
5.3.130.0070.07714.71
5.3.120.0030.04014.58
5.3.110.0100.07314.57
5.3.100.0130.07314.12
5.3.90.0030.07714.03
5.3.80.0000.05714.10
5.3.70.0070.08014.10
5.3.60.0130.07014.01
5.3.50.0100.07013.88
5.3.40.0070.04714.08
5.3.30.0070.07313.91
5.3.20.0030.06013.61
5.3.10.0070.06013.67
5.3.00.0070.07013.70
5.2.170.0030.04311.29
5.2.160.0000.05011.16
5.2.150.0030.02711.08
5.2.140.0100.06011.11
5.2.130.0100.03311.11
5.2.120.0200.04711.04
5.2.110.0100.03711.19
5.2.100.0100.04711.26
5.2.90.0030.04011.13
5.2.80.0070.04711.11
5.2.70.0000.07011.23
5.2.60.0030.06311.07
5.2.50.0100.04010.95
5.2.40.0070.03711.09
5.2.30.0170.05710.92
5.2.20.0000.06710.89
5.2.10.0130.05310.82
5.2.00.0030.06010.87
5.1.60.0070.05010.47
5.1.50.0030.05310.47
5.1.40.0000.03310.47
5.1.30.0100.04710.47
5.1.20.0070.05310.47
5.1.10.0000.05710.47
5.1.00.0030.04010.47
5.0.50.0100.03710.47
5.0.40.0070.03710.47
5.0.30.0070.06010.47
5.0.20.0100.02710.47
5.0.10.0030.04310.47
5.0.00.0030.04710.47
4.4.90.0030.03310.47
4.4.80.0000.03310.47
4.4.70.0000.04010.47
4.4.60.0000.03310.47
4.4.50.0030.03010.47
4.4.40.0030.04710.47
4.4.30.0000.02710.47
4.4.20.0030.02010.47
4.4.10.0100.02310.47
4.4.00.0000.04010.47
4.3.110.0030.03310.47
4.3.100.0000.02310.47
4.3.90.0030.03310.47
4.3.80.0030.05010.47
4.3.70.0070.03010.47
4.3.60.0000.03010.47
4.3.50.0030.03710.47
4.3.40.0030.04710.47
4.3.30.0000.03710.47
4.3.20.0030.02010.47
4.3.10.0070.03010.47
4.3.00.0030.03010.47

preferences:
31.92 ms | 400 KiB | 5 Q