3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Asia/Tehran'); $date1 = new \DateTime('2019-08-21 12:47:24'); $date2 = new \DateTime('2019-09-24 11:47:24'); //$date2 = new \DateTime('2019-08-21 12:47:24'); $diff = $date1->diff($date2); $date3 = new \DateTime('@' . $date1->format('U')); $date4 = new \DateTime('@' . ($date2->format('U')-3600)); //Sun 22 set, 0.00 a.m, when local clocks were set backward 1 hour $diff2 = $date3->diff($date4); if ($diff->h < 0) { echo $diff->format('%R%a Total number of days as a result of a DateTime::diff() or (unknown) otherwise %d days not already covered by the month Time = %H:%I:%S') . PHP_EOL; echo $diff2->format('%R%a Total number of days as a result of a DateTime::diff() or (unknown) otherwise %d days not already covered by the month Time = %H:%I:%S') . PHP_EOL; }

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.0090.00618.40
8.3.50.0110.00316.72
8.3.40.0140.00418.92
8.3.30.0030.01318.97
8.3.20.0080.00024.18
8.3.10.0060.00324.66
8.3.00.0080.00026.16
8.2.180.0060.01025.92
8.2.170.0000.01519.04
8.2.160.0080.00822.96
8.2.150.0090.00025.66
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.35
8.2.110.0070.00321.11
8.2.100.0170.00318.21
8.2.90.0170.00218.21
8.2.80.0140.00718.21
8.2.70.0140.00618.10
8.2.60.0170.00218.24
8.2.50.0140.00518.25
8.2.40.0140.00418.33
8.2.30.0120.00518.29
8.2.20.0070.00518.32
8.2.10.0120.00518.83
8.2.00.0130.00518.81
8.1.280.0120.00325.92
8.1.270.0090.00020.78
8.1.260.0000.00828.09
8.1.250.0050.00328.09
8.1.240.0090.00022.54
8.1.230.0120.00720.60
8.1.220.0110.00618.10
8.1.210.0140.00518.61
8.1.200.0150.00317.96
8.1.190.0130.00517.90
8.1.180.0150.00518.27
8.1.170.0140.00519.60
8.1.160.0150.00419.51
8.1.150.0140.00318.70
8.1.140.0110.00518.60
8.1.130.0130.00419.23
8.1.120.0090.00818.01
8.1.110.0130.00418.01
8.1.100.0100.00717.96
8.1.90.0110.00617.99
8.1.80.0110.00718.02
8.1.70.0140.00417.97
8.1.60.0130.00418.06
8.1.50.0100.00718.06
8.1.40.0100.00618.01
8.1.30.0140.00418.10
8.1.20.0100.00718.08
8.1.10.0120.00518.10
8.1.00.0090.00618.00
8.0.300.0140.00420.10
8.0.290.0210.00317.72
8.0.280.0110.00718.48
8.0.270.0120.00518.35
8.0.260.0120.00518.50
8.0.250.0140.00517.82
8.0.240.0130.00417.86
8.0.230.0150.00517.78
8.0.220.0120.00617.82
8.0.210.0120.00517.78
8.0.200.0120.00517.82
8.0.190.0120.00617.83
8.0.180.0100.00717.76
8.0.170.0140.00417.85
8.0.160.0160.00417.83
8.0.150.0110.00417.74
8.0.140.0200.00217.78
8.0.130.0100.00416.02
8.0.120.0140.00417.79
8.0.110.0160.00117.79
8.0.100.0120.00617.77
8.0.90.0130.00417.74
8.0.80.0110.00817.55
8.0.70.0160.00217.73
8.0.60.0120.00517.71
8.0.50.0110.00617.81
8.0.30.0170.00517.84
8.0.20.0170.00817.81
8.0.10.0120.01117.43
8.0.00.0110.01117.66
7.4.330.0100.00316.99
7.4.320.0130.00417.55
7.4.300.0110.00517.50
7.4.290.0130.00317.45
7.4.280.0100.00617.57
7.4.270.0130.00317.52
7.4.260.0130.00215.91
7.4.250.0150.00117.48
7.4.240.0150.00117.57
7.4.230.0110.00517.54
7.4.220.0110.00317.31
7.4.210.0120.00817.04
7.4.200.0140.00217.49
7.4.190.0200.00418.44
7.4.180.0240.00018.44
7.4.160.0220.00318.44
7.4.150.0240.00018.44
7.4.140.0120.01217.04
7.4.130.0160.00617.13
7.4.120.0110.00917.05
7.4.110.0080.01317.08
7.4.100.0160.00517.14
7.4.90.0140.00717.10
7.4.80.0140.00717.03
7.4.70.0150.00817.09
7.4.60.0180.00417.11
7.4.50.0160.00517.05
7.4.40.0120.00917.03
7.4.30.0140.00717.16
7.4.20.0140.00617.06
7.4.10.0150.00617.07
7.4.00.0130.00717.12
7.3.330.0110.00517.44
7.3.320.0110.00515.84
7.3.310.0090.00717.43
7.3.300.0100.00617.38
7.3.290.0200.00017.38
7.3.280.0220.00318.44
7.3.270.0230.00318.44
7.3.260.0110.01017.11
7.3.250.0130.00916.97
7.3.240.0160.00416.99
7.3.230.0150.00516.99
7.3.220.0150.00617.04
7.3.210.0120.01016.91
7.3.200.0150.00716.99
7.3.190.0150.00917.05
7.3.180.0190.00616.94
7.3.170.0110.01116.99
7.3.160.0150.00617.06
7.3.150.0150.00816.97
7.3.140.0170.00716.94
7.3.130.0170.00517.05
7.3.120.0130.00917.04
7.3.110.0160.00616.93
7.3.100.0150.00617.01
7.3.90.0110.01016.89
7.3.80.0140.00617.01
7.3.70.0110.00916.95
7.3.60.0120.01016.88
7.3.50.0200.01016.93
7.3.40.0150.00816.90
7.3.30.0150.00816.93
7.3.20.0170.00716.98
7.3.10.0110.01116.90
7.3.00.0140.00916.90

preferences:
44.35 ms | 400 KiB | 5 Q