3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Query timestamp of entry //returns like this $entrydatetime = "2013-11-20 17:36:18"; //get current time $now = new \DateTime(); // Use DateTime on $entrydatetime $entrydatetime = new \DateTime($entrydatetime); // Seconds echo $now->getTimestamp() - $entrydatetime->getTimestamp() . "seconds\n"; // Human readable is more complex $age = $entrydatetime->diff($now); var_dump($age); // DateInterval if ($age->y > 0) { echo $age->format('%y years ago'); } else if ($age->m > 0) { echo $age->format('%m months ago'); } else if ($age->days > 0) { echo $age->format('%a days ago'); } else { echo $age->format('%h hours, %i minutes ago'); }

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.0.110.0040.00417.04
8.0.100.0050.00316.98
8.0.90.0070.00016.97
8.0.80.0100.00616.98
8.0.70.0000.00817.09
8.0.60.0000.00816.89
8.0.50.0000.00817.15
8.0.30.0110.00917.16
8.0.20.0100.01017.47
8.0.10.0000.00717.15
8.0.00.0080.01116.84
7.4.240.0000.00716.59
7.4.230.0030.00316.66
7.4.220.0100.01016.62
7.4.210.0070.00816.72
7.4.200.0050.00316.71
7.4.190.0050.00516.81
7.4.160.0140.00316.71
7.4.150.0060.01317.40
7.4.140.0100.00917.86
7.4.130.0090.00916.56
7.4.120.0070.01116.67
7.4.110.0060.01216.66
7.4.100.0100.00616.55
7.4.90.0110.00716.49
7.4.80.0070.01119.39
7.4.70.0040.01316.62
7.4.60.0160.00316.52
7.4.50.0060.00316.55
7.4.40.0080.00822.77
7.4.30.0140.00716.52
7.4.10.0100.00415.07
7.4.00.0080.00814.91
7.3.300.0000.00716.29
7.3.290.0000.01516.30
7.3.280.0080.01016.33
7.3.270.0160.00517.40
7.3.260.0120.00718.24
7.3.250.0110.00616.43
7.3.240.0160.00616.64
7.3.230.0090.00916.39
7.3.210.0140.00316.62
7.3.200.0120.01219.39
7.3.190.0100.00616.46
7.3.180.0120.00616.35
7.3.170.0120.00616.34
7.3.160.0070.01016.63
7.3.130.0090.00915.02
7.3.120.0060.01114.75
7.3.110.0160.00314.71
7.3.100.0090.00914.92
7.3.90.0030.01314.88
7.3.80.0100.00314.88
7.3.70.0060.00914.68
7.3.60.0040.01114.61
7.3.50.0090.00914.80
7.3.40.0040.01114.25
7.3.30.0040.00415.03
7.3.20.0100.00316.74
7.3.10.0090.00716.63
7.3.00.0050.00716.54
7.2.330.0120.00616.59
7.2.320.0120.00616.77
7.2.310.0130.00616.95
7.2.300.0120.01216.66
7.2.290.0110.00716.72
7.2.260.0030.01514.93
7.2.250.0090.00915.30
7.2.240.0040.01115.03
7.2.230.0040.00814.93
7.2.220.0170.00015.18
7.2.210.0030.01415.09
7.2.200.0080.00415.03
7.2.190.0090.00615.18
7.2.180.0000.01315.16
7.2.170.0000.01615.38
7.2.160.0030.00915.07
7.2.150.0110.00316.78
7.2.140.0100.00616.81
7.2.130.0080.00916.88
7.2.120.0080.00716.96
7.2.110.0070.00716.94
7.2.100.0110.00516.93
7.2.90.0050.00816.95
7.2.80.0040.00917.03
7.2.70.0060.00716.97
7.2.60.0080.00517.05
7.2.50.0070.01216.92
7.2.40.0090.00616.95
7.2.30.0070.00717.04
7.2.20.0050.01016.97
7.2.10.0080.00917.03
7.2.00.0060.01017.66
7.1.330.0100.00715.86
7.1.320.0080.00815.50
7.1.310.0040.01115.94
7.1.300.0040.01215.99
7.1.290.0070.00715.75
7.1.280.0060.00315.83
7.1.270.0030.00716.01
7.1.260.0070.00715.86
7.1.250.0080.00715.94
7.1.240.0040.01115.98
7.1.230.0060.00615.88
7.1.220.0090.00315.50
7.1.210.0000.01115.67
7.1.200.0100.00715.76
7.1.190.0030.00915.69
7.1.180.0030.00915.95
7.1.170.0000.01315.76
7.1.160.0110.00015.84
7.1.150.0030.00615.76
7.1.140.0150.00415.65
7.1.130.0070.00715.81
7.1.120.0000.01615.93
7.1.110.0100.00616.09
7.1.100.0030.01016.99
7.1.90.0100.00715.92
7.1.80.0070.00715.74
7.1.70.0050.01216.75
7.1.60.0060.01317.46
7.1.50.0060.01116.43
7.1.40.0030.00815.88
7.1.30.0060.00616.00
7.1.20.0120.00315.64
7.1.10.0060.00915.52
7.1.00.0050.03019.21
7.0.330.0000.01415.23
7.0.320.0090.00915.51
7.0.310.0080.00815.15
7.0.300.0040.00815.30
7.0.290.0100.00315.31
7.0.280.0030.01415.27
7.0.270.0090.00915.50
7.0.260.0070.00315.36
7.0.250.0030.01415.55
7.0.240.0030.01215.38
7.0.230.0060.00915.42
7.0.220.0040.01115.29
7.0.210.0060.00915.54
7.0.200.0020.01016.34
7.0.190.0000.01515.43
7.0.180.0110.00315.59
7.0.170.0060.00915.27
7.0.160.0110.00415.82
7.0.150.0130.00315.59
7.0.140.0040.03518.79
7.0.130.0040.01115.29
7.0.120.0030.01315.24
7.0.110.0060.01515.54
7.0.100.0040.01215.18
7.0.90.0030.00915.43
7.0.80.0110.04517.77
7.0.70.0050.02817.79
7.0.60.0090.02717.64
7.0.50.0090.02917.89
7.0.40.0100.04016.83
7.0.30.0040.04516.74
7.0.20.0040.04616.73
7.0.10.0120.03716.83
7.0.00.0030.05116.79
5.6.400.0030.01014.46
5.6.390.0030.01014.23
5.6.380.0040.00414.75
5.6.370.0100.00613.86
5.6.360.0150.00314.52
5.6.350.0060.01014.30
5.6.340.0100.00614.64
5.6.330.0070.00713.87
5.6.320.0090.00614.34
5.6.310.0060.00914.59
5.6.300.0060.00614.36
5.6.290.0110.00314.54
5.6.280.0080.03717.69
5.6.270.0100.01014.59
5.6.260.0000.01514.58
5.6.250.0060.01314.28
5.6.240.0060.00614.46
5.6.230.0150.04017.42
5.6.220.0060.04317.55
5.6.210.0100.02217.56
5.6.200.0030.03717.76
5.6.190.0040.04817.75
5.6.180.0030.04517.83
5.6.170.0030.03717.57
5.6.160.0100.04017.68
5.6.150.0020.04217.81
5.6.140.0020.04117.73
5.6.130.0050.02917.76
5.6.120.0010.03917.87
5.6.110.0090.02417.55
5.6.100.0040.02817.66
5.6.90.0020.04017.58
5.6.80.0070.02417.58
5.6.70.0030.02417.37
5.6.60.0030.03317.25
5.6.50.0050.03717.31
5.6.40.0110.02217.16
5.6.30.0020.02617.33
5.6.20.0060.02317.28
5.6.10.0070.04517.33
5.6.00.0080.02117.28
5.5.380.0100.00614.06
5.5.370.0030.04817.26
5.5.360.0000.04217.50
5.5.350.0090.04317.41
5.5.340.0080.04117.58
5.5.330.0050.04717.41
5.5.320.0100.04317.60
5.5.310.0050.04317.27
5.5.300.0020.02917.46
5.5.290.0050.03017.59
5.5.280.0060.02517.56
5.5.270.0050.02617.54
5.5.260.0080.02317.38
5.5.250.0060.02217.32
5.5.240.0070.02217.13
5.5.230.0070.04116.99
5.5.220.0030.02617.21
5.5.210.0050.02217.08
5.5.200.0060.02817.20
5.5.190.0100.02717.14
5.5.180.0110.02117.14
5.5.170.0110.00614.50
5.5.160.0050.02317.31
5.5.150.0050.02317.39
5.5.140.0000.02217.33
5.5.130.0060.02217.35
5.5.120.0000.02417.31
5.5.110.0080.04017.25
5.5.100.0070.02517.04
5.5.90.0080.02217.27
5.5.80.0060.02517.35
5.5.70.0000.02517.26
5.5.60.0050.03417.17
5.5.50.0050.02217.32
5.5.40.0030.02517.28
5.5.30.0010.02417.27
5.5.20.0030.02517.16
5.5.10.0030.02817.00
5.5.00.0050.04017.21
5.4.450.0030.02715.56
5.4.440.0020.02415.59
5.4.430.0030.03315.58
5.4.420.0080.02215.54
5.4.410.0020.02515.48
5.4.400.0030.02015.39
5.4.390.0050.03815.42
5.4.380.0070.01815.35
5.4.370.0020.02515.35
5.4.360.0030.02715.49
5.4.350.0030.02515.35
5.4.340.0060.02815.34
5.4.330.0070.00311.73
5.4.320.0050.02015.35
5.4.310.0020.02515.31
5.4.300.0000.02115.43
5.4.290.0020.02515.47
5.4.280.0080.02015.43
5.4.270.0020.02515.28
5.4.260.0050.01815.38
5.4.250.0060.04115.39
5.4.240.0030.02315.43
5.4.230.0070.01815.31
5.4.220.0020.02315.36
5.4.210.0030.02315.33
5.4.200.0020.02315.42
5.4.190.0050.02815.33
5.4.180.0050.03215.42
5.4.170.0050.03715.39
5.4.160.0030.04715.38
5.4.150.0100.03815.37
5.4.140.0070.04214.00
5.4.130.0120.02614.00
5.4.120.0050.03714.04
5.4.110.0030.02714.02
5.4.100.0070.04014.03
5.4.90.0030.04213.97
5.4.80.0030.02813.98
5.4.70.0070.03913.96
5.4.60.0090.03014.06
5.4.50.0050.03713.97
5.4.40.0090.03014.05
5.4.30.0070.03314.01
5.4.20.0040.03014.07
5.4.10.0030.02713.97
5.4.00.0000.04313.77
5.3.290.0020.02013.18
5.3.280.0000.02613.16
5.3.270.0030.02513.15
5.3.260.0030.02313.12
5.3.250.0090.03213.16
5.3.240.0080.03013.10
5.3.230.0090.03713.08
5.3.220.0050.02813.10
5.3.210.0050.03113.13
5.3.200.0020.04613.14
5.3.190.0090.03513.11
5.3.180.0070.03713.14
5.3.170.0070.02013.05
5.3.160.0030.04413.13
5.3.150.0020.02913.13
5.3.140.0020.04413.12
5.3.130.0100.03813.13
5.3.120.0020.03713.12
5.3.110.0050.03313.07
5.3.100.0020.04312.87
5.3.90.0080.03812.85
5.3.80.0020.03812.82
5.3.70.0050.04312.87
5.3.60.0020.04512.84
5.3.50.0030.03612.82
5.3.40.0090.03512.80
5.3.30.0110.03012.79
5.3.20.0070.04012.64
5.3.10.0080.03612.63
5.3.00.0070.04012.65
5.2.170.0100.03011.63
5.2.160.0130.06011.63
5.2.150.0000.07011.63
5.2.140.0030.05711.63
5.2.130.0030.05711.63
5.2.120.0030.06311.63
5.2.110.0030.06311.63
5.2.100.0030.06711.63
5.2.90.0100.05711.63
5.2.80.0070.06311.63
5.2.70.0200.04711.63
5.2.60.0070.05711.63
5.2.50.0030.06311.63
5.2.40.0030.06311.63
5.2.30.0000.06311.63
5.2.20.0070.05711.63
5.2.10.0130.05011.63
5.2.00.0030.06011.63
5.1.60.0000.05311.63
5.1.50.0070.05011.63
5.1.40.0000.05311.63
5.1.30.0070.05311.63
5.1.20.0000.05011.63
5.1.10.0070.04311.63
5.1.00.0030.03711.63
5.0.50.0070.04011.63
5.0.40.0070.03711.63
5.0.30.0100.06711.63
5.0.20.0030.03711.63
5.0.10.0000.04711.63
5.0.00.0030.06011.63
4.4.90.0000.04011.63
4.4.80.0030.03711.63
4.4.70.0070.03311.63
4.4.60.0030.02311.63
4.4.50.0070.03311.63
4.4.40.0030.05011.63
4.4.30.0000.03711.63
4.4.20.0030.03311.63
4.4.10.0000.03711.63
4.4.00.0070.03711.63
4.3.110.0000.03011.63
4.3.100.0000.03711.63
4.3.90.0030.02711.63
4.3.80.0030.05011.63
4.3.70.0030.02311.63
4.3.60.0000.03011.63
4.3.50.0030.03311.63
4.3.40.0000.04311.63
4.3.30.0070.03011.63
4.3.20.0000.04011.63
4.3.10.0070.02311.63
4.3.00.0070.01711.63

preferences:
39.97 ms | 401 KiB | 5 Q