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="2020-09-13 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.0110.00716.75
8.3.50.0240.01521.92
8.3.40.0140.00018.57
8.3.30.0140.00418.71
8.3.20.0040.00420.22
8.3.10.0080.00023.48
8.3.00.0100.00017.49
8.2.180.0090.00918.63
8.2.170.0070.00722.96
8.2.160.0100.00320.17
8.2.150.0000.00824.18
8.2.140.0120.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00417.75
8.2.110.0000.00920.57
8.2.100.0040.00817.93
8.2.90.0000.00819.22
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0040.00421.25
8.2.30.0000.00720.80
8.2.20.0050.00317.93
8.2.10.0000.00818.16
8.2.00.0080.00018.24
8.1.280.0110.01125.92
8.1.270.0040.00423.79
8.1.260.0050.00326.35
8.1.250.0030.00628.09
8.1.240.0090.00323.75
8.1.230.0080.00417.66
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0000.01117.35
8.1.190.0040.00417.36
8.1.180.0040.00418.10
8.1.170.0040.00419.02
8.1.160.0040.00422.04
8.1.150.0040.00418.95
8.1.140.0080.00019.57
8.1.130.0000.00717.75
8.1.120.0040.00417.66
8.1.110.0030.00517.64
8.1.100.0000.00817.52
8.1.90.0000.00717.57
8.1.80.0000.00717.51
8.1.70.0080.00017.63
8.1.60.0030.00617.70
8.1.50.0000.00817.52
8.1.40.0080.00017.58
8.1.30.0100.00017.73
8.1.20.0040.00417.64
8.1.10.0050.00317.63
8.1.00.0000.00717.64
8.0.300.0050.00318.77
8.0.290.0000.00716.75
8.0.280.0070.00018.42
8.0.270.0080.00017.21
8.0.260.0000.00717.17
8.0.250.0000.00717.18
8.0.240.0000.00717.01
8.0.230.0030.00517.18
8.0.220.0040.00417.12
8.0.210.0020.00517.10
8.0.200.0000.00717.11
8.0.190.0070.00017.07
8.0.180.0040.00416.97
8.0.170.0040.00416.95
8.0.160.0050.00316.95
8.0.150.0080.00017.05
8.0.140.0000.00816.95
8.0.130.0060.00013.38
8.0.120.0000.00816.99
8.0.110.0040.00416.89
8.0.100.0040.00416.86
8.0.90.0070.00017.13
8.0.80.0080.00816.98
8.0.70.0040.00416.84
8.0.60.0000.00716.88
8.0.50.0050.00217.04
8.0.30.0060.01217.12
8.0.20.0110.01117.40
8.0.10.0040.00417.18
8.0.00.0080.01016.93
7.4.330.0030.00315.08
7.4.320.0000.00716.63
7.4.300.0040.00416.72
7.4.290.0000.01016.61
7.4.280.0050.00516.59
7.4.270.0030.00316.59
7.4.260.0060.00316.68
7.4.250.0060.00316.68
7.4.240.0010.00616.66
7.4.230.0070.00016.80
7.4.220.0000.01716.64
7.4.210.0090.01016.62
7.4.200.0000.00716.82
7.4.160.0030.01316.47
7.4.150.0030.01617.40
7.4.140.0080.01217.86
7.4.130.0140.00716.61
7.4.120.0090.01016.61
7.4.110.0100.00716.66
7.4.100.0080.01216.57
7.4.90.0120.00616.61
7.4.80.0100.01019.39
7.4.70.0060.00916.55
7.4.60.0080.00816.58
7.4.50.0040.00416.60
7.4.40.0120.00916.47
7.4.30.0130.00316.81
7.4.00.0050.01214.94
7.3.330.0030.00313.33
7.3.320.0050.00013.37
7.3.310.0050.00216.36
7.3.300.0030.00316.32
7.3.290.0040.00416.48
7.3.280.0090.00716.45
7.3.270.0100.00717.40
7.3.260.0060.01016.47
7.3.240.0060.01216.54
7.3.230.0060.01016.52
7.3.210.0030.01316.59
7.3.200.0110.00916.60
7.3.190.0040.01216.33
7.3.180.0030.01716.55
7.3.170.0120.00816.69
7.3.160.0140.00716.64
7.3.120.0110.00714.90
7.3.110.0100.00715.16
7.3.100.0060.00614.73
7.3.90.0100.00315.04
7.3.80.0030.01314.83
7.3.70.0100.00714.91
7.3.60.0030.01014.77
7.3.50.0120.00314.52
7.3.40.0040.01115.02
7.3.30.0080.00815.00
7.3.20.0060.00616.68
7.3.10.0120.00316.93
7.3.00.0090.00616.74
7.2.330.0060.01216.60
7.2.320.0130.00316.63
7.2.310.0030.01516.61
7.2.300.0130.00316.68
7.2.290.0120.00616.85
7.2.250.0060.01215.04
7.2.240.0070.01015.10
7.2.230.0090.00915.37
7.2.220.0050.00814.96
7.2.210.0030.01315.06
7.2.200.0060.01114.95
7.2.190.0070.01414.95
7.2.180.0060.01014.98
7.2.170.0030.00614.93
7.2.00.0040.00719.65
7.1.330.0000.01515.60
7.1.320.0030.00715.78
7.1.310.0030.01515.74
7.1.300.0000.01715.82
7.1.290.0070.00716.04
7.1.280.0080.00415.80
7.1.270.0000.01315.71
7.1.260.0070.01015.86
7.1.100.0040.00417.89
7.1.70.0060.00617.38
7.1.60.0160.00319.43
7.1.50.0100.01316.98
7.1.00.0030.07722.37
7.0.200.0100.01514.82
7.0.60.0030.04319.93
7.0.50.0100.07717.90
7.0.40.0070.04020.11
7.0.30.0170.04320.10
7.0.20.0300.08320.36
7.0.10.0030.08020.22
7.0.00.0070.08720.27
5.6.280.0000.03321.09
5.6.210.0070.07020.68
5.6.200.0000.07018.18
5.6.190.0070.09020.55
5.6.180.0270.07720.57
5.6.170.0200.03720.52
5.6.160.0070.08020.58
5.6.150.0000.08718.15
5.6.140.0030.04018.18
5.6.130.0030.06718.21
5.6.120.0130.07021.02
5.6.110.0100.08020.98
5.6.100.0070.07321.10
5.6.90.0030.04720.98
5.6.80.0130.07720.37
5.5.350.4400.03720.34
5.5.340.0230.05718.02
5.5.330.0030.04320.57
5.5.320.0230.05020.51
5.5.310.0300.04720.19
5.5.300.0070.03717.96
5.5.290.0030.05317.98
5.5.280.0200.06020.75
5.5.270.0100.04320.73
5.5.260.0030.04020.68
5.5.250.0030.04320.59
5.5.240.0030.07320.25
5.4.450.0070.06319.61
5.4.440.0170.05019.61
5.4.430.0170.05719.19
5.4.420.0100.07019.38
5.4.410.0100.06019.06
5.4.400.0470.04719.09
5.4.390.0670.05319.28
5.4.380.0700.05018.84
5.4.370.0200.05019.13
5.4.360.0070.06319.26
5.4.350.0200.05719.37
5.4.340.0630.05719.15
5.4.320.0670.05019.39
5.4.310.0270.04719.03
5.4.300.0200.05018.88
5.4.290.0400.05319.14
5.4.280.0600.06319.15
5.4.270.0730.06019.32
5.4.260.0100.05719.24
5.4.250.0170.07319.00
5.4.240.0230.08019.21
5.4.230.0530.08019.27
5.4.220.0300.05019.37
5.4.210.0830.07319.15
5.4.200.0870.06019.30
5.4.190.0630.07019.22
5.4.180.0230.04319.29
5.4.170.0200.05019.24
5.4.160.0500.07019.00
5.4.150.0330.07319.27
5.4.140.0530.06016.59
5.4.130.0730.05316.57
5.4.120.0200.05316.77
5.4.110.0370.05016.29
5.4.100.0170.05316.67
5.4.90.0300.04716.65
5.4.80.0530.05316.56
5.4.70.0630.06716.48
5.4.60.0470.06316.30
5.4.50.0630.08016.19
5.4.40.0570.06016.40
5.4.30.0070.07016.57
5.4.20.0230.06016.48
5.4.10.0330.05316.23
5.4.00.0570.06315.74

preferences:
73.79 ms | 401 KiB | 5 Q