3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = new DateTime(null, new DateTimeZone('UTC')); $todaydate=$now->format('Y-m-d H:i:s'); $expdate="2015-10-30 21:00:00"; function format_interval(DateInterval $interval) { $result = ""; if ($interval->y) { $result .= $interval->format("%y years "); } if ($interval->m) { $result .= $interval->format("%m months "); } if ($interval->d) { $result .= $interval->format("%d days "); } if ($interval->h) { $result .= $interval->format("%h hours "); } if ($interval->i) { $result .= $interval->format("%i minutes "); } if ($interval->s) { $result .= $interval->format("%s seconds "); } return $result; } $exp_date = new DateTime($expdate); $today_date = new DateTime($todaydate); $difference = $exp_date->diff($today_date); // Average 60 days over 2 months if($difference->days <= 60) { echo $difference->format('%Y-%m-%d'); }

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.0070.01116.75
8.3.50.0090.01122.11
8.3.40.0180.00418.70
8.3.30.0040.01118.96
8.3.20.0040.00420.34
8.3.10.0090.00023.52
8.3.00.0030.00617.75
8.2.180.0100.01318.41
8.2.170.0030.01022.96
8.2.160.0070.01320.19
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00417.75
8.2.110.0110.00022.07
8.2.100.0120.00018.05
8.2.90.0040.00419.27
8.2.80.0040.00417.97
8.2.70.0090.00017.88
8.2.60.0000.00817.91
8.2.50.0060.00318.07
8.2.40.0030.00621.13
8.2.30.0040.00420.64
8.2.20.0080.00018.05
8.2.10.0000.00918.22
8.2.00.0000.00718.28
8.1.280.0100.01025.92
8.1.270.0040.00423.79
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0030.00622.52
8.1.230.0000.01117.77
8.1.220.0040.00417.80
8.1.210.0030.00518.77
8.1.200.0040.00417.36
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0030.00618.98
8.1.160.0020.00521.91
8.1.150.0080.00018.85
8.1.140.0090.00019.66
8.1.130.0000.00717.66
8.1.120.0000.00717.50
8.1.110.0040.00417.64
8.1.100.0040.00317.61
8.1.90.0000.00717.64
8.1.80.0000.00717.66
8.1.70.0030.00317.63
8.1.60.0000.00917.62
8.1.50.0000.00817.60
8.1.40.0030.00517.52
8.1.30.0030.00617.83
8.1.20.0000.00917.76
8.1.10.0000.00817.76
8.1.00.0040.00417.71
8.0.300.0040.00418.77
8.0.290.0030.00617.00
8.0.280.0030.00318.42
8.0.270.0030.00317.41
8.0.260.0000.00617.27
8.0.250.0070.00017.07
8.0.240.0030.00317.23
8.0.230.0000.00717.11
8.0.220.0030.00316.95
8.0.210.0000.00716.93
8.0.200.0030.00617.07
8.0.190.0040.00417.05
8.0.180.0040.00417.07
8.0.170.0050.00217.05
8.0.160.0070.00016.97
8.0.150.0000.01016.95
8.0.140.0000.00717.05
8.0.130.0000.00613.48
8.0.120.0000.00816.98
8.0.110.0040.00417.05
8.0.100.0040.00417.01
8.0.90.0000.00816.93
8.0.80.0090.00617.09
8.0.70.0030.00516.89
8.0.60.0000.00717.09
8.0.50.0040.00417.00
8.0.30.0080.01017.09
8.0.20.0130.00817.40
8.0.10.0040.00417.04
8.0.00.0060.01016.93
7.4.330.0050.00015.08
7.4.320.0040.00416.59
7.4.300.0000.00716.68
7.4.290.0100.00016.52
7.4.280.0040.00716.60
7.4.270.0030.00316.51
7.4.260.0000.00716.60
7.4.250.0000.00716.64
7.4.240.0050.00216.70
7.4.230.0000.00716.49
7.4.220.0090.00916.73
7.4.210.0060.00816.72
7.4.200.0000.00816.42
7.4.160.0070.01016.64
7.4.150.0040.01417.40
7.4.140.0060.01517.86
7.4.130.0060.01816.81
7.4.120.0120.00516.79
7.4.110.0060.01216.71
7.4.100.0060.01516.84
7.4.90.0030.01316.48
7.4.80.0030.01419.39
7.4.70.0090.01016.73
7.4.60.0090.00716.72
7.4.50.0040.00416.52
7.4.40.0080.01116.59
7.4.30.0080.00816.84
7.4.00.0070.01115.01
7.3.330.0030.00313.39
7.3.320.0030.00313.22
7.3.310.0030.00516.46
7.3.300.0070.00016.47
7.3.290.0000.00616.42
7.3.280.0060.01316.50
7.3.270.0070.01017.40
7.3.260.0040.01416.51
7.3.240.0090.00916.47
7.3.230.0110.00416.62
7.3.210.0140.00416.60
7.3.200.0130.00316.48
7.3.190.0160.00016.48
7.3.180.0110.00516.38
7.3.170.0150.00616.52
7.3.160.0040.01116.45
7.3.120.0130.00314.87
7.3.110.0030.00915.09
7.3.100.0060.00914.39
7.3.90.0110.00315.09
7.3.80.0100.00714.75
7.3.70.0060.00314.80
7.3.60.0070.00314.68
7.3.50.0090.01214.92
7.3.40.0030.01714.96
7.3.30.0040.01414.87
7.3.20.0060.00616.66
7.3.10.0040.01116.73
7.3.00.0090.00316.45
7.2.330.0030.01416.86
7.2.320.0090.00916.98
7.2.310.0120.00916.88
7.2.300.0100.00716.93
7.2.290.0030.02116.96
7.2.250.0130.00614.93
7.2.240.0060.01214.85
7.2.230.0030.00915.18
7.2.220.0070.01015.19
7.2.210.0040.01515.15
7.2.200.0060.00914.82
7.2.190.0070.01015.14
7.2.180.0060.01515.34
7.2.170.0130.00715.29
7.2.60.0070.01017.01
7.2.00.0030.01219.59
7.1.330.0000.01615.93
7.1.320.0000.01216.05
7.1.310.0090.00615.88
7.1.300.0030.01016.04
7.1.290.0030.01415.67
7.1.280.0060.01315.97
7.1.270.0040.00816.00
7.1.260.0070.01015.92
7.1.200.0060.00615.75
7.1.100.0070.00718.36
7.1.70.0000.00717.13
7.1.60.0060.01919.43
7.1.50.0110.01416.48
7.1.00.0030.07722.28
7.0.200.0060.00615.02
7.0.60.0070.08019.95
7.0.50.0100.07317.91
7.0.40.0070.08720.24
7.0.30.0170.04320.25
7.0.20.0370.07320.10
7.0.10.0000.08320.19
7.0.00.0100.07720.17
5.6.280.0100.05021.08
5.6.210.0100.08320.57
5.6.200.0130.07018.19
5.6.190.0100.04320.48
5.6.180.0270.07320.46
5.6.170.0170.06020.56
5.6.160.0100.08020.50
5.6.150.0030.08718.29
5.6.140.0030.04318.15
5.6.130.0100.06318.21
5.6.120.0000.06021.15
5.6.110.0070.08721.04
5.6.100.0100.06321.12
5.6.90.0070.05720.97
5.6.80.0030.08020.50
5.5.350.4300.04020.43
5.5.340.0170.04718.08
5.5.330.0070.06020.47
5.5.320.0230.05320.20
5.5.310.0330.04320.37
5.5.300.0070.03718.07
5.5.290.0030.08017.98
5.5.280.0030.04720.66
5.5.270.0100.08020.68
5.5.260.0070.04020.88
5.5.250.0000.04320.59
5.5.240.0000.07720.29
5.4.450.0530.07019.46
5.4.440.0230.06319.47
5.4.430.0330.05319.62
5.4.420.0130.05719.60
5.4.410.0470.06319.34
5.4.400.0530.06018.84
5.4.390.0570.06719.28
5.4.380.0270.05319.30
5.4.370.0370.06719.25
5.4.360.0330.06719.06
5.4.350.0400.06719.38
5.4.340.0300.06019.38
5.4.320.0330.05319.25
5.4.310.0200.05019.22
5.4.300.0230.05018.86
5.4.290.0200.06319.06
5.4.280.0270.06719.01
5.4.270.0930.04318.98
5.4.260.0600.05319.29
5.4.250.0130.06019.14
5.4.240.0270.05719.25
5.4.230.0170.06719.25
5.4.220.0270.05319.14
5.4.210.0270.06318.86
5.4.200.0200.05318.84
5.4.190.0300.06018.98
5.4.180.0330.06318.85
5.4.170.0230.06019.09
5.4.160.0700.05719.36
5.4.150.0770.05719.36
5.4.140.0730.06016.58
5.4.130.0270.06016.56
5.4.120.0200.05716.62
5.4.110.0300.07316.50
5.4.100.0230.06316.50
5.4.90.0230.06316.67
5.4.80.0470.05016.22
5.4.70.0970.06016.65
5.4.60.0770.05316.67
5.4.50.0600.06316.39
5.4.40.0600.07016.61
5.4.30.0500.05316.54
5.4.20.0700.04716.58
5.4.10.0200.05316.48
5.4.00.0700.04315.96

preferences:
62.37 ms | 401 KiB | 5 Q