3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTopNews($number = 5,$reset =false) { static $cache = false; //cache reset if ($reset) $cache = false; //cache get if ($cache){ echo 'cache '; return $cache; } else { echo 'query '; /*$res = db_query("SELECT id,header,content FROM `news` ORDER BY id DESC LIMIT %d",(int)$number); while($row = db_fetch_array($res)){ $out[] = $row; } */ $out ='db'; //cache set $cache = $out; } return $out; } getTopNews(); echo '<hr>'; getTopNews();

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.0150.00318.30
8.3.50.0070.01222.05
8.3.40.0140.00318.71
8.3.30.0120.00318.97
8.3.20.0040.00420.25
8.3.10.0040.00422.05
8.3.00.0000.00922.52
8.2.180.0150.00316.50
8.2.170.0110.00422.96
8.2.160.0150.00020.93
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.01026.16
8.2.120.0030.00517.38
8.2.110.0000.00922.24
8.2.100.0040.00819.17
8.2.90.0050.00319.22
8.2.80.0040.00417.97
8.2.70.0030.00517.50
8.2.60.0000.00918.03
8.2.50.0040.00418.07
8.2.40.0040.00418.28
8.2.30.0040.00418.05
8.2.20.0060.00317.52
8.2.10.0000.00717.74
8.2.00.0070.00017.66
8.1.280.0100.01025.92
8.1.270.0090.00022.14
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00323.97
8.1.230.0100.00019.09
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0030.00617.22
8.1.190.0040.00417.53
8.1.180.0030.00618.73
8.1.170.0000.00818.66
8.1.160.0040.00422.02
8.1.150.0020.00818.58
8.1.140.0040.00417.35
8.1.130.0070.00017.72
8.1.120.0050.00217.30
8.1.110.0040.00417.43
8.1.100.0050.00317.30
8.1.90.0000.00717.43
8.1.80.0000.00817.26
8.1.70.0030.00317.34
8.1.60.0060.00317.60
8.1.50.0030.00617.43
8.1.40.0000.00817.55
8.1.30.0040.00417.63
8.1.20.0040.00417.65
8.1.10.0000.00717.39
8.1.00.0030.00517.48
8.0.300.0040.00418.77
8.0.290.0070.00017.18
8.0.280.0030.00318.27
8.0.270.0070.00017.25
8.0.260.0000.00716.68
8.0.250.0000.00716.96
8.0.240.0000.00716.96
8.0.230.0000.00716.93
8.0.220.0000.00716.94
8.0.210.0000.00716.80
8.0.200.0070.00016.89
8.0.190.0000.00816.93
8.0.180.0040.00716.93
8.0.170.0000.00716.86
8.0.160.0040.00416.75
8.0.150.0040.00416.84
8.0.140.0000.00816.68
8.0.130.0030.00313.39
8.0.120.0040.00416.87
8.0.110.0000.00816.72
8.0.100.0070.00016.84
8.0.90.0000.00716.70
8.0.80.0100.00416.89
8.0.70.0030.00516.82
8.0.60.0000.00716.91
8.0.50.0020.00516.73
8.0.30.0080.01316.97
8.0.20.0080.01117.40
8.0.10.0040.00417.02
8.0.00.0120.00416.68
7.4.330.0000.00515.08
7.4.320.0000.00616.36
7.4.300.0000.00616.39
7.4.290.0040.00416.50
7.4.280.0000.00716.48
7.4.270.0000.00816.54
7.4.260.0070.00016.52
7.4.250.0000.00716.53
7.4.240.0050.00216.45
7.4.230.0030.00316.68
7.4.220.0100.00616.67
7.4.210.0070.00816.53
7.4.200.0030.00316.67
7.4.190.0000.00716.39
7.4.160.0090.01216.29
7.4.150.0100.00717.40
7.4.140.0180.00317.86
7.4.130.0110.00516.45
7.4.120.0080.00816.52
7.4.110.0070.01016.37
7.4.100.0080.01616.72
7.4.90.0060.00616.33
7.4.80.0120.00419.39
7.4.70.0060.00916.54
7.4.60.0040.01216.47
7.4.50.0040.00016.57
7.4.40.0080.00822.77
7.4.30.0130.00316.69
7.4.00.0070.01014.66
7.3.330.0030.00313.13
7.3.320.0030.00313.14
7.3.310.0000.00716.32
7.3.300.0040.00416.23
7.3.290.0090.00916.34
7.3.280.0100.00716.29
7.3.270.0100.00717.40
7.3.260.0070.01316.51
7.3.250.0110.00616.27
7.3.240.0120.00416.63
7.3.230.0160.00016.39
7.3.210.0030.01616.26
7.3.200.0060.01019.39
7.3.190.0140.00316.49
7.3.180.0120.00916.43
7.3.170.0090.01216.34
7.3.160.0110.00516.28
7.3.120.0090.00614.77
7.2.330.0060.01616.61
7.2.320.0090.01316.68
7.2.310.0090.00916.34
7.2.300.0070.01116.26
7.2.290.0040.01216.29
7.2.00.0060.00819.03
7.1.100.0330.00518.24
7.1.70.0000.01017.23
7.1.60.0060.01019.82
7.1.50.0120.01216.96
7.1.00.0130.06722.51
7.0.200.0040.00816.72
7.0.140.0070.06722.18
7.0.60.0000.07320.05
7.0.50.0100.07717.88
7.0.40.0070.06020.08
7.0.30.0230.07020.34
7.0.20.0300.07320.23
7.0.10.0230.08720.06
7.0.00.0030.06020.23
5.6.280.0100.06721.15
5.6.210.0030.08320.70
5.6.200.0070.05018.27
5.6.190.0070.04020.41
5.6.180.4070.04020.41
5.6.170.0330.07720.56
5.6.160.0000.04720.55
5.6.150.0100.07318.16
5.6.140.0070.08318.26
5.6.130.0100.06018.17
5.6.120.0030.04321.13
5.6.110.0100.04321.05
5.6.100.0030.09320.99
5.6.90.0000.09321.00
5.6.80.0000.04020.49
5.6.70.1500.03720.41
5.5.350.0130.06720.53
5.5.340.0100.03317.95
5.5.330.0000.04720.21
5.5.320.0200.04720.30
5.5.310.0130.04320.23
5.5.300.0100.07717.97
5.5.290.0070.07018.08
5.5.280.0170.04320.65
5.5.270.0070.04020.86
5.5.260.0130.08020.76
5.5.250.0030.04720.58
5.5.240.0030.04320.16
5.4.450.0600.07019.39
5.4.440.0630.06319.45
5.4.430.0100.05319.41
5.4.420.0000.06319.42
5.4.410.0100.05319.21
5.4.400.0770.00018.82
5.4.390.0730.00018.79
5.4.380.0230.06318.70
5.4.370.0400.05318.77
5.4.360.0330.05018.50
5.4.350.0430.04018.84
5.4.340.0230.05318.59
5.4.320.0070.03712.50
5.4.310.0090.04112.50
5.4.300.0080.04212.50
5.4.290.0070.03612.50
5.4.280.0040.03912.40
5.4.270.0100.07318.62
5.4.260.0370.09718.95
5.4.250.0170.05318.86
5.4.240.0070.07718.79
5.4.230.0130.06719.09
5.4.220.0270.06018.80
5.4.210.0230.07019.02
5.4.200.0230.05718.75
5.4.190.0300.06018.74
5.4.180.0070.06018.93
5.4.170.0130.05019.10
5.4.160.0000.08318.98
5.4.150.0100.08318.68
5.4.140.0030.05316.34
5.4.130.0170.05716.25
5.4.120.0100.06016.25
5.4.110.0170.04716.36
5.4.100.0030.07016.54
5.4.90.0170.04016.49
5.4.80.0070.05316.47
5.4.70.0070.05316.35
5.4.60.0130.05016.34
5.4.50.0070.05316.36
5.4.40.0230.04316.44
5.4.30.0100.06316.52
5.4.20.0070.07716.62
5.4.10.0100.05316.46
5.4.00.0070.05015.75
5.3.290.0060.05012.80
5.3.280.0230.05014.81
5.3.270.0070.05714.77
5.3.260.0100.05014.68
5.3.250.0270.04014.77
5.3.240.0070.05714.82
5.3.230.0100.07014.68
5.3.220.0130.04314.47
5.3.210.0100.05314.64
5.3.200.0130.07014.74
5.3.190.0130.06014.39
5.3.180.0200.07014.73
5.3.170.0070.06314.71
5.3.160.0130.04714.57
5.3.150.0130.05314.53
5.3.140.0130.05714.63
5.3.130.0230.05014.53
5.3.120.0130.05014.68
5.3.110.0170.06014.63
5.3.100.0030.06714.11
5.3.90.0100.04714.01
5.3.80.0070.06314.09
5.3.70.0100.04714.08
5.3.60.0070.05314.08
5.3.50.0230.05313.95
5.3.40.0130.04314.12
5.3.30.0170.06014.07
5.3.20.0070.05013.75
5.3.10.0030.07313.48
5.3.00.0200.04013.66
5.2.170.0030.06311.14
5.2.160.0170.04311.32
5.2.150.0070.06011.13
5.2.140.0100.03711.22
5.2.130.0030.04011.32
5.2.120.0030.04310.93
5.2.110.0170.04011.07
5.2.100.0070.03711.18
5.2.90.0100.04010.92
5.2.80.0030.04711.08
5.2.70.0030.04711.17
5.2.60.0100.05711.14
5.2.50.0100.04011.01
5.2.40.0070.05010.97
5.2.30.0170.04311.05
5.2.20.0130.03711.13
5.2.10.0070.05010.94
5.2.00.0030.05010.67
5.1.60.0100.0379.95
5.1.50.0100.03010.19
5.1.40.0070.0479.89
5.1.30.0100.04010.41
5.1.20.0030.05010.18
5.1.10.0070.03310.27
5.1.00.0070.07010.07
5.0.50.0130.0378.64
5.0.40.0030.0338.38
5.0.30.0070.0438.29
5.0.20.0000.0308.26
5.0.10.0070.0338.26
5.0.00.0030.0438.08
4.4.90.0030.0207.61
4.4.80.0100.0207.61
4.4.70.0030.0237.61
4.4.60.0030.0207.61
4.4.50.0000.0237.61
4.4.40.0070.0307.61
4.4.30.0000.0237.61
4.4.20.0100.0177.61
4.4.10.0000.0237.61
4.4.00.0000.0507.61
4.3.110.0030.0237.61
4.3.100.0000.0237.61
4.3.90.0070.0177.61
4.3.80.0030.0477.61
4.3.70.0070.0207.61
4.3.60.0000.0237.61
4.3.50.0000.0337.61
4.3.40.0070.0377.61
4.3.30.0000.0237.61
4.3.20.0000.0277.61
4.3.10.0030.0207.61
4.3.00.0030.0308.20

preferences:
53.51 ms | 401 KiB | 5 Q