3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * test that filemtime() returns Unix timestamp (UTC) on current system */ $timestampStartOfUnixEpoch = 0; // start of the Unix epoch. $timestampRequest = 3600 * (int) ($_SERVER['REQUEST_TIME'] / 3600); $testFile = sprintf('%s/%s', sys_get_temp_dir(), 'test-filemtime'); printf("Testfile is '%s'.\n", $testFile); touch($testFile, $timestampStartOfUnixEpoch); clearstatcache(false, $testFile); $mtime = filemtime($testFile); printf("Testfile '%s' mtime should be from touch %d, is %d.\n", basename($testFile), $timestampStartOfUnixEpoch, $mtime); printf("The mtime represents %s\n", date('r', $mtime)); touch($testFile, $timestampRequest); clearstatcache(false, $testFile); $mtime = filemtime($testFile); printf("Testfile '%s' mtime should be from touch %d, is %d.\n", basename($testFile), $timestampRequest, $mtime); printf("The mtime represents %s\n", date('r', $mtime)); unlink($testFile);

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.00716.73
8.3.60.0140.00016.49
8.3.50.0150.00822.91
8.3.40.0110.00418.71
8.3.30.0110.00319.19
8.3.20.0030.00620.16
8.3.10.0080.00023.48
8.3.00.0080.00017.50
8.2.180.0090.00616.50
8.2.170.0140.00722.96
8.2.160.0030.01020.35
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00421.04
8.2.110.0000.00921.92
8.2.100.0070.00717.91
8.2.90.0000.00819.15
8.2.80.0030.00617.97
8.2.70.0080.00017.50
8.2.60.0000.00818.16
8.2.50.0030.00618.07
8.2.40.0090.00318.15
8.2.30.0050.00218.27
8.2.20.0040.00417.91
8.2.10.0040.00418.09
8.2.00.0000.00817.97
8.1.280.0040.01425.92
8.1.270.0060.00323.84
8.1.260.0070.00726.35
8.1.250.0040.00428.09
8.1.240.0000.00923.81
8.1.230.0080.00319.07
8.1.220.0000.00917.74
8.1.210.0030.00518.77
8.1.200.0030.00617.48
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0040.00418.71
8.1.160.0070.00022.05
8.1.150.0000.00718.89
8.1.140.0030.00517.48
8.1.130.0030.00317.49
8.1.120.0040.00417.61
8.1.110.0050.00317.67
8.1.100.0030.00417.69
8.1.90.0000.00717.57
8.1.80.0040.00417.62
8.1.70.0030.00317.60
8.1.60.0060.00317.67
8.1.50.0000.00817.57
8.1.40.0090.00017.67
8.1.30.0040.00417.60
8.1.20.0000.00817.78
8.1.10.0090.00017.63
8.1.00.0050.00317.59
8.0.300.0000.00818.77
8.0.290.0090.00016.88
8.0.280.0040.00418.59
8.0.270.0030.00717.33
8.0.260.0030.00316.99
8.0.250.0040.00417.18
8.0.240.0000.00816.96
8.0.230.0030.00316.96
8.0.220.0000.00716.94
8.0.210.0050.00317.06
8.0.200.0040.00417.16
8.0.190.0030.00517.14
8.0.180.0030.00517.07
8.0.170.0070.00017.01
8.0.160.0040.00416.93
8.0.150.0000.00817.07
8.0.140.0000.00717.12
8.0.130.0030.00313.36
8.0.120.0030.00516.96
8.0.110.0050.00317.13
8.0.100.0040.00417.18
8.0.90.0070.00017.14
8.0.80.0120.00617.10
8.0.70.0040.00417.19
8.0.60.0000.00716.91
8.0.50.0050.00216.96
8.0.30.0110.01117.08
8.0.20.0130.00917.40
8.0.10.0030.00517.19
8.0.00.0070.01016.90
7.4.330.0000.00515.03
7.4.320.0000.00616.74
7.4.300.0000.00716.62
7.4.290.0000.00716.70
7.4.280.0040.00416.70
7.4.270.0000.00716.60
7.4.260.0000.00716.59
7.4.250.0040.00416.66
7.4.240.0030.00416.75
7.4.230.0030.00316.50
7.4.220.0120.01516.70
7.4.210.0110.01116.66
7.4.200.0050.00216.36
7.4.160.0090.00616.59
7.4.150.0130.00717.40
7.4.140.0140.00717.86
7.4.130.0050.01516.61
7.4.120.0110.00616.63
7.4.110.0100.00716.54
7.4.100.0160.00316.63
7.4.90.0120.00616.72
7.4.80.0070.01019.39
7.4.70.0060.01116.68
7.4.60.0160.00616.76
7.4.50.0050.00516.67
7.4.40.0130.01116.60
7.4.30.0130.01016.67
7.4.00.0100.00715.12
7.3.330.0050.00013.09
7.3.320.0040.00413.32
7.3.310.0000.00716.33
7.3.300.0070.00016.36
7.3.290.0030.01016.36
7.3.280.0090.00716.33
7.3.270.0000.01817.40
7.3.260.0130.00316.60
7.3.250.0150.00916.58
7.3.240.0070.01516.63
7.3.230.0040.01216.55
7.3.210.0100.01016.61
7.3.200.0120.00619.39
7.3.190.0100.00716.39
7.3.180.0100.01016.43
7.3.170.0130.00716.54
7.3.160.0030.01316.67
7.3.120.0130.00314.88
7.3.110.0110.00414.96
7.3.100.0000.01114.98
7.3.90.0060.00615.10
7.3.80.0000.01615.02
7.3.70.0060.00314.62
7.3.60.0040.01114.68
7.3.50.0040.01115.05
7.3.40.0160.00014.73
7.3.30.0000.01214.88
7.3.20.0110.00316.71
7.3.10.0170.00016.78
7.3.00.0070.01016.81
7.2.330.0100.01116.45
7.2.320.0120.01516.59
7.2.310.0090.00916.47
7.2.300.0060.01216.63
7.2.290.0120.00916.59
7.2.240.0120.00315.11
7.2.230.0100.00715.54
7.2.220.0120.00315.40
7.2.210.0060.01215.42
7.2.200.0100.00715.31
7.2.190.0100.00715.07
7.2.180.0040.01115.04
7.2.170.0030.01415.18
7.2.160.0070.00714.99
7.2.150.0090.00617.07
7.2.140.0090.00917.07
7.2.130.0080.00316.97
7.2.120.0140.00417.08
7.2.110.0040.01117.03
7.2.100.0070.01116.91
7.2.90.0040.01417.23
7.2.80.0040.01516.91
7.2.70.0130.00316.72
7.2.60.0070.01117.16
7.2.50.0070.00717.13
7.2.40.0070.01116.77
7.2.30.0060.00817.00
7.2.20.0060.01016.98
7.2.10.0030.01317.04
7.2.00.0080.00918.21
7.1.330.0080.00815.97
7.1.320.0030.01016.01
7.1.310.0000.01115.98
7.1.300.0000.01716.11
7.1.290.0040.01415.99
7.1.280.0100.00715.80
7.1.270.0150.00015.43
7.1.260.0070.00715.73
7.1.250.0130.00315.91
7.1.100.0030.00918.29
7.1.70.0030.00617.18
7.1.60.0160.00619.40
7.1.50.0120.00917.14
7.1.00.0030.07722.35
7.0.200.0050.00316.64
7.0.140.0100.07022.12
7.0.100.0030.08019.94
7.0.90.0100.08020.01
7.0.80.0070.08320.05
7.0.70.0130.07020.03
7.0.60.0070.05719.91
7.0.50.0100.04720.27
7.0.40.0130.06720.18
7.0.30.0030.08020.13
7.0.20.0100.08320.03
7.0.10.0100.09020.10
7.0.00.0070.08020.07
5.6.280.0070.07021.11
5.6.250.0000.06020.66
5.6.240.0070.05020.50
5.6.230.0170.07720.63
5.6.220.0100.08320.59
5.6.210.0100.07720.64
5.6.200.0130.07321.14
5.6.190.0030.07321.02
5.6.180.0000.08321.00
5.6.170.0000.08720.95
5.6.160.0070.09021.01
5.6.150.0070.08020.95
5.6.140.0130.07721.08
5.6.130.0070.06021.10
5.6.120.0130.03721.06
5.6.110.0030.07721.03
5.6.100.0070.08321.02
5.6.90.0030.08720.93
5.6.80.0070.08320.46
5.6.70.0100.07320.48
5.6.60.0070.07020.31
5.6.50.0100.05720.40
5.6.40.0130.07320.39
5.6.30.0030.08320.31
5.6.20.0170.04720.43
5.6.10.0130.06020.37
5.6.00.0030.08720.39
5.5.380.0070.08320.34
5.5.370.0100.08320.32
5.5.360.0100.04720.38
5.5.350.0030.07020.37
5.5.340.0070.07720.82
5.5.330.0000.05320.83
5.5.320.0030.09020.64
5.5.310.0030.07720.88
5.5.300.0100.07020.77
5.5.290.0000.05320.82
5.5.280.0130.07020.78
5.5.270.0200.04320.75
5.5.260.0100.09020.85
5.5.250.0000.09320.73
5.5.240.0100.08020.24
5.5.230.0100.07020.02
5.5.220.0100.08020.26
5.5.210.0070.08020.14
5.5.200.0170.06320.18
5.5.190.0100.08020.22
5.5.180.0070.07020.07
5.5.160.0230.06320.11
5.5.150.0130.07320.14
5.5.140.0070.08020.27
5.5.130.0170.07020.11
5.5.120.0070.08320.10
5.5.110.0000.08320.22
5.5.100.0000.07020.12
5.5.90.0100.04720.16
5.5.80.0070.08020.14
5.5.70.0100.07720.06
5.5.60.0130.06720.05
5.5.50.0070.08020.05
5.5.40.0100.07020.01
5.5.30.0100.08020.10
5.5.20.0130.06020.05
5.5.10.0200.06720.03
5.5.00.0100.07719.96
5.4.450.0070.07019.43
5.4.440.0070.06719.40
5.4.430.0030.04019.36
5.4.420.0200.06719.46
5.4.410.0030.07319.10
5.4.400.0000.07018.79
5.4.390.0000.08718.79
5.4.380.0100.06319.06
5.4.370.0000.08018.79
5.4.360.0030.07018.82
5.4.350.0030.06718.90
5.4.340.0100.07019.11
5.4.320.0100.07319.13
5.4.310.0130.06719.14
5.4.300.0070.07318.95
5.4.290.0100.07319.05
5.4.280.0030.08019.07
5.4.270.0000.06018.81
5.4.260.0100.06019.03
5.4.250.0100.06319.05
5.4.240.0100.07718.97
5.4.230.0070.06018.80
5.4.220.0070.04019.02
5.4.210.0070.05018.95
5.4.200.0070.03718.78
5.4.190.0100.07318.98
5.4.180.0130.07018.80
5.4.170.0070.07719.06
5.4.160.0130.07718.99
5.4.150.0000.06718.88
5.4.140.0030.07716.36
5.4.130.0100.05016.27
5.4.120.0100.03716.12
5.4.110.0100.03316.32
5.4.100.0070.03716.43
5.4.90.0070.03316.34
5.4.80.0000.04016.30
5.4.70.0070.04016.19
5.4.60.0000.04316.39
5.4.50.0030.03316.32
5.4.40.0070.03316.25
5.4.30.0030.03016.29
5.4.20.0000.04016.41
5.4.10.0030.07316.41
5.4.00.0030.03715.80
5.3.290.0070.07314.50
5.3.280.0100.07714.59
5.3.270.0100.07314.55
5.3.260.0070.07314.60
5.3.250.0030.07314.55
5.3.240.0100.05014.61
5.3.230.0030.04714.59
5.3.220.0000.04314.57
5.3.210.0070.03314.40
5.3.200.0030.04314.51
5.3.190.0000.04314.48
5.3.180.0030.03714.52
5.3.170.0030.03714.39
5.3.160.0070.03714.54
5.3.150.0000.04014.56
5.3.140.0030.03714.49
5.3.130.0030.03714.40
5.3.120.0030.06314.41
5.3.110.0070.03314.54
5.3.100.0070.03014.03
5.3.90.0000.04014.01
5.3.80.0100.03013.79
5.3.70.0000.05013.97
5.3.60.0030.04713.95
5.3.50.0070.03313.80
5.3.40.0030.03713.93
5.3.30.0000.03713.87
5.3.20.0130.02713.68
5.3.10.0000.03713.60
5.3.00.0070.05013.50
5.2.170.0000.03711.13
5.2.160.0070.03310.96
5.2.150.0000.03011.16
5.2.140.0030.06311.13
5.2.130.0000.04011.09
5.2.120.0000.03011.17
5.2.110.0070.03011.09
5.2.100.0000.03010.92
5.2.90.0030.02311.07
5.2.80.0000.04711.06
5.2.70.0000.03011.16
5.2.60.0000.06010.91
5.2.50.0000.05710.97
5.2.40.0100.03010.82
5.2.30.0000.03010.79
5.2.20.0030.03010.75
5.2.10.0070.02010.76
5.2.00.0000.03010.77
5.1.60.0000.02710.69
5.1.50.0000.02710.69
5.1.40.0000.02710.69
5.1.30.0030.02310.69
5.1.20.0000.02710.69
5.1.10.0030.02710.69
5.1.00.0030.02310.69
5.0.50.0000.02010.69
5.0.40.0030.01710.69
5.0.30.0000.03010.69
5.0.20.0000.02010.69
5.0.10.0000.02710.69
5.0.00.0030.02710.69
4.4.90.0030.01310.69
4.4.80.0000.02010.69
4.4.70.0000.02310.69
4.4.60.0030.01310.69
4.4.50.0030.01310.69
4.4.40.0000.02710.69
4.4.30.0000.01710.69
4.4.20.0000.01310.69
4.4.10.0000.01710.69
4.4.00.0000.02310.69
4.3.110.0000.01710.69
4.3.100.0000.01310.69
4.3.90.0000.01710.69
4.3.80.0030.02010.69
4.3.70.0000.01710.69
4.3.60.0000.01710.69
4.3.50.0000.02010.69
4.3.40.0000.03010.69
4.3.30.0000.01710.69
4.3.20.0070.03010.69
4.3.10.0000.02310.69
4.3.00.0000.02710.69

preferences:
44.32 ms | 401 KiB | 5 Q