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 = tempnam(sys_get_temp_dir(), 'test-dropbox-uploader');printf("PHP version is %s.\n", PHP_VERSION);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.60.0100.00316.38
8.3.50.0140.00719.70
8.3.40.0090.00618.59
8.3.30.0140.00019.14
8.3.20.0040.00420.33
8.3.10.0050.00323.73
8.3.00.0080.00017.35
8.2.180.0110.01116.50
8.2.170.0170.00322.96
8.2.160.0100.00320.47
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00021.00
8.2.110.0100.00021.89
8.2.100.0120.00317.77
8.2.90.0040.00419.05
8.2.80.0000.00817.97
8.2.70.0050.00317.50
8.2.60.0040.00417.92
8.2.50.0040.00418.07
8.2.40.0060.00318.07
8.2.30.0000.00717.84
8.2.20.0000.00717.61
8.2.10.0030.00517.86
8.2.00.0070.00017.46
8.1.280.0070.00725.92
8.1.270.0040.00423.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0070.00323.88
8.1.230.0030.00918.95
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0030.00717.23
8.1.190.0000.00816.98
8.1.180.0000.00718.10
8.1.170.0030.00618.59
8.1.160.0040.00421.95
8.1.150.0030.00318.75
8.1.140.0040.00417.16
8.1.130.0030.00317.62
8.1.120.0030.00317.22
8.1.110.0000.00717.32
8.1.100.0030.00317.32
8.1.90.0030.00317.37
8.1.80.0000.00717.22
8.1.70.0030.00317.27
8.1.60.0030.00517.43
8.1.50.0080.00017.36
8.1.40.0060.00317.38
8.1.30.0030.00617.42
8.1.20.0020.00517.54
8.1.10.0080.00017.45
8.1.00.0040.00417.39
8.0.300.0000.00718.77
8.0.290.0080.00016.63
8.0.280.0040.00418.38
8.0.270.0000.01017.18
8.0.260.0060.00017.17
8.0.250.0030.00316.82
8.0.240.0060.00316.71
8.0.230.0000.00716.82
8.0.220.0000.00716.66
8.0.210.0030.00516.75
8.0.200.0060.00016.80
8.0.190.0040.00416.67
8.0.180.0040.00416.78
8.0.170.0000.00816.67
8.0.160.0000.00816.79
8.0.150.0040.00416.69
8.0.140.0070.00016.66
8.0.130.0030.00313.37
8.0.120.0040.00416.75
8.0.110.0050.00216.79
8.0.100.0000.00716.81
8.0.90.0040.00416.63
8.0.80.0090.00616.70
8.0.70.0070.00016.64
8.0.60.0040.00416.76
8.0.50.0040.00416.75
8.0.30.0100.01216.70
8.0.20.0090.01117.40
8.0.10.0050.00316.82
8.0.00.0100.01016.66
7.4.330.0020.00215.11
7.4.320.0050.00216.51
7.4.300.0000.00716.32
7.4.290.0030.00316.39
7.4.280.0000.00816.48
7.4.270.0000.00716.27
7.4.260.0030.00316.45
7.4.250.0050.00216.47
7.4.240.0030.00316.43
7.4.230.0040.00416.27
7.4.220.0070.01116.38
7.4.210.0140.00716.45
7.4.200.0040.00316.42
7.4.160.0090.00616.43
7.4.150.0130.00317.40
7.4.140.0100.00917.86
7.4.130.0110.01016.41
7.4.120.0100.00716.42
7.4.110.0060.00916.29
7.4.100.0030.01416.35
7.4.90.0090.00616.44
7.4.80.0150.00919.39
7.4.70.0050.01216.44
7.4.60.0080.00816.24
7.4.50.0000.00916.23
7.4.40.0060.01716.33
7.4.30.0100.00716.16
7.3.330.0050.00013.22
7.3.320.0070.00013.08
7.3.310.0000.00716.12
7.3.300.0030.00316.13
7.3.290.0110.00316.14
7.3.280.0080.00916.09
7.3.270.0140.00317.40
7.3.260.0100.01316.16
7.3.250.0120.00716.29
7.3.240.0160.00016.50
7.3.230.0000.01816.48
7.3.210.0070.01016.16
7.3.200.0190.00019.39
7.3.190.0130.00616.48
7.3.180.0120.00416.33
7.3.170.0030.01216.27
7.3.160.0120.00316.34
7.2.330.0100.01016.29
7.2.320.0100.01016.56
7.2.310.0100.00616.58
7.2.300.0030.01916.61
7.2.290.0130.00416.29
5.4.320.0070.03512.45
5.4.310.0060.03712.45
5.4.300.0030.04012.45
5.4.290.0060.03812.45
5.4.280.0040.03712.34
5.4.270.0050.03612.35
5.4.260.0080.03512.35
5.4.250.0030.03912.35
5.4.240.0040.03712.35
5.4.230.0060.03612.34
5.4.220.0050.03512.34
5.4.210.0040.03612.34
5.4.200.0060.03712.34
5.4.190.0060.03612.33
5.4.180.0060.03912.33
5.4.170.0070.03512.34
5.4.160.0070.03512.34
5.4.150.0050.03612.34
5.4.140.0050.03712.02
5.4.130.0050.03512.01
5.4.120.0050.03711.97
5.4.110.0040.04011.96
5.4.100.0070.03611.96
5.4.90.0040.03811.96
5.4.80.0080.03411.96
5.4.70.0050.03411.96
5.4.60.0050.03411.96
5.4.50.0050.04311.96
5.4.40.0040.04111.95
5.4.30.0060.03411.95
5.4.20.0050.03411.95
5.4.10.0040.03611.95
5.4.00.0070.03411.44

preferences:
40.51 ms | 400 KiB | 5 Q