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); // DateInterval if ($age->years > 0) { echo $age->format('%y years ago'); } else if ($age->months > 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.3.60.0120.00316.88
8.3.50.0120.00722.18
8.3.40.0040.01118.88
8.3.30.0140.00019.07
8.3.20.0000.00720.34
8.3.10.0080.00023.70
8.3.00.0040.00420.69
8.2.180.0100.00716.50
8.2.170.0110.00419.06
8.2.160.0130.00622.96
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0030.00626.16
8.2.120.0070.00422.21
8.2.110.0030.00620.95
8.2.100.0150.00317.96
8.2.90.0000.00819.26
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0000.00818.05
8.2.50.0030.00518.10
8.2.40.0060.00318.09
8.2.30.0060.00318.14
8.2.20.0070.00017.86
8.2.10.0070.00017.93
8.2.00.0040.00417.94
8.1.280.0100.00725.92
8.1.270.0030.00523.99
8.1.260.0080.00026.35
8.1.250.0030.01428.09
8.1.240.0060.00322.75
8.1.230.0070.00317.77
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00617.60
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0040.00418.59
8.1.160.0040.00421.89
8.1.150.0040.00418.83
8.1.140.0040.00417.57
8.1.130.0040.00417.88
8.1.120.0040.00417.68
8.1.110.0000.01017.59
8.1.100.0040.00417.55
8.1.90.0000.00817.66
8.1.80.0040.00417.68
8.1.70.0000.00717.55
8.1.60.0080.00017.76
8.1.50.0040.00417.68
8.1.40.0050.00317.62
8.1.30.0000.00817.71
8.1.20.0000.00817.79
8.1.10.0000.00817.77
8.1.00.0000.00817.57
8.0.300.0080.00018.77
8.0.290.0080.00017.00
8.0.280.0070.00018.56
8.0.270.0030.00517.37
8.0.260.0000.00617.10
8.0.250.0080.00017.25
8.0.240.0040.00417.21
8.0.230.0050.00217.14
8.0.220.0030.00317.16
8.0.210.0040.00417.12
8.0.200.0080.00017.25
8.0.190.0040.00417.21
8.0.180.0040.00417.23
8.0.170.0070.00017.24
8.0.160.0000.00717.06
8.0.150.0040.00417.08
8.0.140.0020.00517.14
8.0.130.0030.00313.54
8.0.120.0080.00017.17
8.0.110.0040.00417.05
8.0.100.0070.00016.94
8.0.90.0040.00417.03
8.0.80.0100.00517.18
8.0.70.0080.00017.20
8.0.60.0040.00417.04
8.0.50.0000.00717.04
8.0.30.0140.00817.30
8.0.20.0080.01017.40
8.0.10.0000.00717.32
8.0.00.0130.00816.92
7.4.330.0000.00515.03
7.4.320.0000.00616.70
7.4.300.0030.00316.78
7.4.290.0070.00016.75
7.4.280.0040.00416.67
7.4.270.0030.00316.75
7.4.260.0000.00716.64
7.4.250.0000.00716.69
7.4.240.0070.00016.62
7.4.230.0000.00716.45
7.4.220.0060.01216.64
7.4.210.0090.00716.72
7.4.200.0030.00516.71
7.4.190.0030.00316.57
7.4.160.0110.00416.78
7.4.150.0060.01317.40
7.4.140.0090.00817.86
7.4.130.0090.01116.70
7.4.120.0160.00516.68
7.4.110.0070.01016.73
7.4.100.0140.00716.79
7.4.90.0090.01216.81
7.4.80.0140.00316.43
7.4.70.0140.00416.80
7.4.60.0100.00616.76
7.4.50.0040.00416.43
7.4.40.0110.00422.77
7.4.30.0130.00616.64
7.4.00.0090.00615.22
7.3.330.0030.00313.27
7.3.320.0000.00513.27
7.3.310.0060.00316.25
7.3.300.0030.00316.31
7.3.290.0060.00916.37
7.3.280.0060.01116.42
7.3.270.0080.00817.40
7.3.260.0170.00716.42
7.3.250.0100.00716.50
7.3.240.0170.00316.50
7.3.230.0030.01316.57
7.3.210.0190.00616.34
7.3.200.0030.01719.39
7.3.190.0090.00816.50
7.3.180.0120.00416.50
7.3.170.0070.01016.79
7.3.160.0120.00816.50
7.3.120.0100.00714.73
7.2.330.0030.02017.07
7.2.320.0120.00616.53
7.2.310.0100.00716.92
7.2.300.0120.00916.77
7.2.290.0120.00416.58
7.2.60.0030.01217.07
7.2.00.0070.01019.50
7.1.200.0120.00015.69
7.1.100.0000.00818.53
7.1.70.0070.00316.95
7.1.60.0130.01319.29
7.1.50.0060.01617.03
7.1.00.0030.07322.27
7.0.200.0050.00516.98
7.0.140.0030.07322.00
7.0.60.0100.07320.03
7.0.50.0030.04017.79
7.0.40.0070.05019.96
7.0.30.0230.04320.20
7.0.20.0230.06320.12
7.0.10.0070.06720.30
7.0.00.0200.07020.17
5.6.280.0030.07320.80
5.6.210.0130.07020.66
5.6.200.0030.07318.21
5.6.190.0100.08020.57
5.6.180.0070.05720.56
5.6.170.0330.03720.38
5.6.160.0070.06720.61
5.6.150.0100.03718.11
5.6.140.0030.04718.12
5.6.130.0100.04718.18
5.6.120.0070.08020.97
5.6.110.0070.05720.96
5.6.100.0070.04021.13
5.6.90.0030.07020.87
5.6.80.0100.07020.42
5.5.350.0030.09020.52
5.5.340.0030.05017.96
5.5.330.0100.08720.23
5.5.320.0000.04720.27
5.5.310.0370.07720.18
5.5.300.0070.03717.98
5.5.290.0000.04317.96
5.5.280.0000.04720.97
5.5.270.0070.07020.89
5.5.260.0000.05020.79
5.5.250.0100.07020.54
5.5.240.0100.03720.27
5.4.450.0200.07319.42
5.4.440.0330.06719.13
5.4.430.0270.06319.20
5.4.420.0270.06319.38
5.4.410.0270.07319.00
5.4.400.0300.07018.82
5.4.390.0170.05719.16
5.4.380.0270.05719.09
5.4.370.0130.04719.14
5.4.360.0370.03019.08
5.4.350.0270.04019.22
5.4.340.0230.05718.80
5.4.320.0300.05319.11
5.4.310.0170.05019.24
5.4.300.0200.05018.88
5.4.290.0270.06719.10
5.4.280.0300.06718.91
5.4.270.0300.06319.21
5.4.260.0270.03719.25
5.4.250.0230.07319.09
5.4.240.0300.04318.87
5.4.230.0270.06319.09
5.4.220.0300.07019.24
5.4.210.0300.06719.25
5.4.200.0230.07019.07
5.4.190.0170.08319.21
5.4.180.0200.04319.24
5.4.170.0270.07019.14
5.4.160.0270.06719.06
5.4.150.0270.06019.07
5.4.140.0200.05316.50
5.4.130.0230.04016.50
5.4.120.0200.07016.42
5.4.110.0200.07316.55
5.4.100.0230.07016.48
5.4.90.0200.03716.43
5.4.80.0270.07016.43
5.4.70.0230.04316.34
5.4.60.0230.06716.36
5.4.50.0130.05016.28
5.4.40.0270.06316.36
5.4.30.0170.04316.47
5.4.20.0230.06716.18
5.4.10.0270.03016.36
5.4.00.0300.06315.88
5.3.290.0230.06314.51
5.3.280.0300.07014.49
5.3.270.0200.04714.45
5.3.260.0200.05014.55
5.3.250.0230.05714.55
5.3.240.0170.07714.55
5.3.230.0300.06314.45
5.3.220.0200.05314.66
5.3.210.0270.04314.42
5.3.200.0330.05314.66
5.3.190.0330.06714.51
5.3.180.0230.05714.40
5.3.170.0330.03314.40
5.3.160.0330.04714.44
5.3.150.0170.06014.54
5.3.140.0300.06714.39
5.3.130.0200.04314.59
5.3.120.0330.06014.52
5.3.110.0200.04014.45
5.3.100.0230.06713.88
5.3.90.0230.05013.86
5.3.80.0270.06313.95
5.3.70.0230.05013.86
5.3.60.0270.06013.86
5.3.50.0300.06713.91
5.3.40.0230.05313.75
5.3.30.0330.06013.74
5.3.20.0230.06013.64
5.3.10.0300.04713.56
5.3.00.0230.04713.51
5.2.170.0270.05712.04
5.2.160.0130.03312.04
5.2.150.0230.05712.04
5.2.140.0230.05312.04
5.2.130.0200.05312.04
5.2.120.0330.04712.04
5.2.110.0270.03712.04
5.2.100.0130.03712.04
5.2.90.0070.04312.04
5.2.80.0230.07012.04
5.2.70.0230.05012.04
5.2.60.0200.04012.04
5.2.50.0130.05712.04
5.2.40.0170.06312.04
5.2.30.0230.05012.04
5.2.20.0170.03312.04
5.2.10.0200.04712.04
5.2.00.0230.05312.04
5.1.60.0130.05712.04
5.1.50.0170.04312.04
5.1.40.0170.04312.04
5.1.30.0330.03312.04
5.1.20.0130.05312.04
5.1.10.0170.05312.04
5.1.00.0130.05712.04
5.0.50.0130.02712.04
5.0.40.0230.03012.04
5.0.30.0100.06012.04
5.0.20.0130.03012.04
5.0.10.0100.02712.04
5.0.00.0070.03712.04
4.4.90.0130.03712.04
4.4.80.0170.02712.04
4.4.70.0070.02012.04
4.4.60.0070.02012.04
4.4.50.0070.03712.04
4.4.40.0130.02312.04
4.4.30.0070.04012.04
4.4.20.0100.02312.04
4.4.10.0070.02312.04
4.4.00.0100.05712.04
4.3.110.0130.01712.04
4.3.100.0130.02312.04
4.3.90.0100.02312.04
4.3.80.0100.02712.04
4.3.70.0030.01712.04
4.3.60.0030.02012.04
4.3.50.0130.03012.04
4.3.40.0170.03712.04
4.3.30.0030.02312.04
4.3.20.0130.02012.04
4.3.10.0100.03312.04
4.3.00.0070.03312.04

preferences:
48.34 ms | 401 KiB | 5 Q