3v4l.org

run code in 300+ PHP versions simultaneously
<?php //get the last-modified-date of this very file $lastModified=filemtime($_SERVER['SCRIPT_FILENAME']); //get a unique hash of this file (etag) $etagFile = md5_file($_SERVER['SCRIPT_FILENAME']); //get the HTTP_IF_MODIFIED_SINCE header if set $ifModifiedSince=(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false); //get the HTTP_IF_NONE_MATCH header if set (etag: unique file hash) $etagHeader=(isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH']) : false); header("Last-Modified: ".gmdate("D, d M Y H:i:s", $lastModified)." GMT"); header("Etag: $etagFile"); $ttc=60*60*24*8; header('Cache-Control: private; max-age='.$ttc); header('Expires: '.gmdate("D, d M Y H:i:s", time() + $ttc)); header("Pragma: cache"); //check if page has changed. If not, send 304 and exit if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])==$lastModified || $etagHeader == $etagFile) { header("HTTP/1.1 304 Not Modified"); exit; } //your normal code echo "<!-- This page was last modified: ".date("d.m.Y H:i:s",$lastModified)." -->"; ?>

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.4.10.0070.01416.85
7.4.00.0070.01016.68
7.3.130.0120.00316.65
7.3.120.0060.01115.80
7.3.110.0120.00415.93
7.3.100.0080.00315.78
7.3.90.0050.00815.69
7.3.80.0080.00615.82
7.3.70.0060.01015.74
7.3.60.0060.00915.74
7.3.50.0050.01015.91
7.3.40.0050.00915.82
7.3.30.0080.00815.71
7.3.20.0090.01317.56
7.3.10.0050.01417.26
7.3.00.0090.00717.17
7.2.260.0040.01116.97
7.2.250.0070.01416.53
7.2.240.0030.01016.13
7.2.230.0030.01015.85
7.2.220.0070.00515.90
7.2.210.0070.00715.74
7.2.200.0060.00815.96
7.2.190.0070.01015.99
7.2.180.0030.01016.07
7.2.170.0060.01016.14
7.2.160.0060.01415.88
7.2.150.0050.01217.71
7.2.140.0090.00617.88
7.2.130.0060.01017.45
7.2.120.0040.01317.45
7.2.110.0070.00817.33
7.2.100.0060.01317.38
7.2.90.0090.00917.63
7.2.80.0090.00817.59
7.2.70.0090.00717.48
7.2.60.0070.00817.33
7.2.50.0050.00817.47
7.2.40.0070.00817.39
7.2.30.0070.01117.29
7.2.20.0100.00817.45
7.2.10.0050.01017.47
7.2.00.0130.00217.98
7.1.330.0100.00416.77
7.1.320.0050.00916.82
7.1.310.0090.00616.68
7.1.300.0020.01416.81
7.1.290.0050.00916.62
7.1.280.0050.01116.68
7.1.270.0060.00716.49
7.1.260.0060.01016.82
7.1.250.0110.00716.29
7.1.240.0060.00917.48
7.1.230.0100.00717.46
7.1.220.0040.01217.35
7.1.210.0000.00917.51
7.1.200.0040.01016.77
7.1.190.0030.00817.40
7.1.180.0000.01117.50
7.1.170.0060.00917.40
7.1.160.0090.00617.54
7.1.150.0000.01317.52
7.1.140.0100.00317.54
7.1.130.0080.00317.48
7.1.120.0090.00317.48
7.1.110.0090.00317.51
7.1.100.0040.00717.96
7.1.90.0030.00717.32
7.1.80.0030.01217.59
7.1.70.0050.00717.52
7.1.60.0070.01218.36
7.1.50.0100.00917.40
7.1.40.0060.00617.39
7.1.30.0060.00617.30
7.1.20.0040.00817.50
7.1.10.0100.00317.29
7.1.00.0030.04419.80
7.0.330.0040.01517.14
7.0.320.0070.01017.13
7.0.310.0080.00817.14
7.0.300.0000.01317.11
7.0.290.0070.00717.10
7.0.280.0030.01317.10
7.0.270.0040.00817.14
7.0.260.0070.01017.07
7.0.250.0090.00617.09
7.0.240.0070.00417.10
7.0.230.0060.00317.05
7.0.220.0090.00617.24
7.0.210.0030.01017.30
7.0.200.0020.01116.96
7.0.190.0090.00316.85
7.0.180.0090.00017.14
7.0.170.0060.00617.27
7.0.160.0040.00917.05
7.0.150.0040.00417.26
7.0.140.0130.03219.65
7.0.130.0000.01017.26
7.0.120.0030.01016.93
7.0.110.0000.01317.06
7.0.100.0080.02318.56
7.0.90.0030.03218.47
7.0.80.0070.04518.64
7.0.70.0110.02918.49
7.0.60.0060.02518.50
7.0.50.0080.03818.78
7.0.40.0020.03017.54
7.0.30.0070.04317.71
7.0.20.0030.04617.59
7.0.10.0070.04217.40
7.0.00.0060.04017.56
5.6.400.0040.00816.14
5.6.390.0060.00915.91
5.6.380.0080.00816.39
5.6.370.0040.01116.21
5.6.360.0100.00716.03
5.6.350.0040.00816.10
5.6.340.0110.00716.07
5.6.330.0110.00716.24
5.6.320.0060.00916.02
5.6.310.0070.01016.07
5.6.300.0030.01016.12
5.6.290.0000.00916.09
5.6.280.0070.03718.54
5.6.270.0060.01216.26
5.6.260.0000.01316.04
5.6.250.0060.04618.33
5.6.240.0030.03818.39
5.6.230.0120.03318.43
5.6.220.0020.02518.24
5.6.210.0030.03918.36
5.6.200.0130.03818.47
5.6.190.0110.02718.43
5.6.180.0060.02318.72
5.6.170.0060.04618.61
5.6.160.0050.02718.46
5.6.150.0060.02918.42
5.6.140.0070.04218.63
5.6.130.0050.02918.43
5.6.120.0100.04318.54
5.6.110.0050.04918.56
5.6.100.0110.01818.52
5.6.90.0070.04818.61
5.6.80.0030.04818.31
5.6.70.0090.03518.23
5.6.60.0100.03518.14
5.6.50.0030.04618.25
5.6.40.0050.03518.12
5.6.30.0050.02418.19
5.6.20.0020.04418.16
5.6.10.0050.02918.26
5.6.00.0050.02418.23
5.5.380.0030.03818.35
5.5.370.0050.04318.27
5.5.360.0030.03818.14
5.5.350.0100.04418.15
5.5.340.0070.03718.21
5.5.330.0080.02218.45
5.5.320.0110.02618.43
5.5.310.0070.02218.46
5.5.300.0110.01718.40
5.5.290.0070.03718.59
5.5.280.0050.02718.36
5.5.270.0050.04418.41
5.5.260.0030.04518.38
5.5.250.0030.03218.27
5.5.240.0080.02218.08
5.5.230.0060.02318.00
5.5.220.0090.03618.18
5.5.210.0080.03518.12
5.5.200.0080.02118.04
5.5.190.0040.03718.14
5.5.180.0070.04318.07
5.5.170.0000.01016.00
5.5.160.0080.04017.94
5.5.150.0060.03418.08
5.5.140.0100.01918.17
5.5.130.0080.02817.96
5.5.120.0040.02217.97
5.5.110.0030.03918.05
5.5.100.0080.04018.03
5.5.90.0020.02318.01
5.5.80.0070.02018.12
5.5.70.0070.02517.88
5.5.60.0020.04118.10
5.5.50.0100.04318.02
5.5.40.0070.02318.02
5.5.30.0100.02318.04
5.5.20.0050.02317.89
5.5.10.0050.02517.91
5.5.00.0080.04018.04
5.4.450.0030.04515.97
5.4.440.0110.01815.92
5.4.430.0000.02815.99
5.4.420.0070.03315.95
5.4.410.0070.03915.94
5.4.400.0030.02115.96
5.4.390.0050.02415.89
5.4.380.0020.02215.90
5.4.370.0040.02115.79
5.4.360.0100.01715.87
5.4.350.0050.04515.89
5.4.340.0070.04015.89
5.4.330.0070.00312.71
5.4.320.0030.04315.87
5.4.310.0050.02415.93
5.4.300.0050.02315.91
5.4.290.0090.01715.85
5.4.280.0070.03015.87
5.4.270.0040.02015.96
5.4.260.0010.02115.91
5.4.250.0090.03115.95
5.4.240.0040.03715.89
5.4.230.0050.01815.86
5.4.220.0070.01815.97
5.4.210.0050.02415.82
5.4.200.0100.03315.75
5.4.190.0100.02515.94
5.4.180.0050.02515.95
5.4.170.0010.02415.74
5.4.160.0050.02115.87
5.4.150.0090.02115.91
5.4.140.0050.03714.64
5.4.130.0030.04014.59
5.4.120.0050.02014.48
5.4.110.0030.03014.57
5.4.100.0050.03314.50
5.4.90.0050.04014.54
5.4.80.0070.02714.49
5.4.70.0000.02214.58
5.4.60.0030.03414.45
5.4.50.0070.01814.59
5.4.40.0070.03714.52
5.4.30.0050.03814.45
5.4.20.0030.02214.56
5.4.10.0040.04314.54
5.4.00.0030.03614.13
5.3.290.0050.04014.02
5.3.280.0020.03713.83
5.3.270.0000.04213.84
5.3.260.0050.02013.83
5.3.250.0060.03114.00
5.3.240.0050.02213.91
5.3.230.0050.02213.87
5.3.220.0000.02713.85
5.3.210.0030.02313.80
5.3.200.0050.03513.77
5.3.190.0020.02813.82
5.3.180.0060.04113.95
5.3.170.0020.04613.96
5.3.160.0070.01813.87
5.3.150.0070.04013.89
5.3.140.0030.04313.92
5.3.130.0070.04313.86
5.3.120.0070.04013.75
5.3.110.0050.02313.77
5.3.100.0110.03513.67
5.3.90.0080.04213.50
5.3.80.0010.03913.39
5.3.70.0090.01613.38
5.3.60.0080.03713.58
5.3.50.0050.03713.59
5.3.40.0070.02413.52
5.3.30.0120.03713.50
5.3.20.0080.02313.44
5.3.10.0100.03613.21
5.3.00.0050.04013.30
5.2.170.0070.05011.16
5.2.160.0030.06011.21
5.2.150.0030.05011.14
5.2.140.0030.05311.13
5.2.130.0000.03311.16
5.2.120.0030.05310.91
5.2.110.0030.06711.12
5.2.100.0130.05011.14
5.2.90.0030.03311.12
5.2.80.0030.06710.98
5.2.70.0070.05011.04
5.2.60.0030.04711.02
5.2.50.0100.05711.04
5.2.40.0000.05011.00
5.2.30.0030.05310.96
5.2.20.0030.03711.02
5.2.10.0030.06010.88
5.2.00.0030.04310.78
5.1.60.0030.02710.05
5.1.50.0000.0279.88
5.1.40.0000.0339.99
5.1.30.0030.04010.46
5.1.20.0070.04710.42
5.1.10.0030.0309.92
5.1.00.0030.05310.18
5.0.50.0100.0409.67
5.0.40.0070.0409.67
5.0.30.0030.0639.67
5.0.20.0000.0239.67
5.0.10.0070.0409.67
5.0.00.0100.0479.67
4.4.90.0070.0209.67
4.4.80.0000.0209.67
4.4.70.0000.0339.67
4.4.60.0000.0379.67
4.4.50.0000.0339.67
4.4.40.0070.0239.67
4.4.30.0070.0339.67
4.4.20.0000.0239.67
4.4.10.0000.0309.67
4.4.00.0000.0279.67
4.3.110.0070.0109.67
4.3.100.0070.0109.67
4.3.90.0030.0109.67
4.3.80.0030.0509.67
4.3.70.0000.0239.67
4.3.60.0000.0209.67
4.3.50.0000.0209.67
4.3.40.0000.0279.67
4.3.30.0030.0179.67
4.3.20.0030.0339.67
4.3.10.0000.0279.67
4.3.00.0030.0179.67

preferences:
38.97 ms | 401 KiB | 5 Q