3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calcDays($startdate, $enddate) { $first = $startdate < $enddate ? $startdate : $enddate; $second = $startdate < $enddate ? $enddate : $startdate; $inbetween = $second - $first; $i[0] = 60; $i[1] = 24; $i[2] = 7; $i[3] = date('t', strtotime('-1 month', $second)); $month = -20; $days = floor($inbetween / 60 / 60 / 24 % 30); $hours = floor($inbetween / 60 / 60 % $i[1]); $minutes = floor($inbetween / 60 % $i[0]); $seconds = $inbetween % $i[0]; return $days . " " . $hours . " " . $minutes . " " . $seconds . " " . $inbetween; } echo calcDays(1388389166, 1419925156);

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.01218.80
8.3.50.0120.00721.14
8.3.40.0180.00318.96
8.3.30.0110.00420.17
8.3.20.0040.00420.16
8.3.10.0000.00721.07
8.3.00.0000.00722.46
8.2.180.0070.01116.50
8.2.170.0150.00022.96
8.2.160.0120.00922.28
8.2.150.0050.00324.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0040.00420.84
8.2.110.0050.00520.93
8.2.100.0090.00318.03
8.2.90.0000.00819.34
8.2.80.0030.00617.97
8.2.70.0060.00317.88
8.2.60.0060.00318.05
8.2.50.0050.00318.07
8.2.40.0040.00418.28
8.2.30.0050.00219.42
8.2.20.0030.00517.88
8.2.10.0040.00418.09
8.2.00.0050.00218.02
8.1.280.0110.00725.92
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0000.00821.49
8.1.230.0040.00817.70
8.1.220.0030.00517.91
8.1.210.0060.00318.77
8.1.200.0000.00917.75
8.1.190.0040.00417.60
8.1.180.0030.00618.10
8.1.170.0040.00418.89
8.1.160.0080.00018.95
8.1.150.0050.00318.81
8.1.140.0000.00717.77
8.1.130.0000.00717.91
8.1.120.0050.00217.75
8.1.110.0000.00717.71
8.1.100.0000.00717.70
8.1.90.0040.00417.75
8.1.80.0040.00417.66
8.1.70.0030.00317.65
8.1.60.0030.00617.69
8.1.50.0040.00417.63
8.1.40.0060.00317.63
8.1.30.0030.00617.84
8.1.20.0080.00017.83
8.1.10.0000.00917.83
8.1.00.0030.00517.83
8.0.300.0000.00718.77
8.0.290.0050.00217.00
8.0.280.0030.00318.60
8.0.270.0070.00017.35
8.0.260.0060.00017.11
8.0.250.0050.00217.11
8.0.240.0040.00417.26
8.0.230.0070.00317.17
8.0.220.0040.00417.20
8.0.210.0030.00317.04
8.0.200.0060.00017.25
8.0.190.0000.00717.23
8.0.180.0070.00017.10
8.0.170.0020.00517.23
8.0.160.0070.00017.20
8.0.150.0030.00617.11
8.0.140.0070.00016.97
8.0.130.0070.00013.56
8.0.120.0000.00717.09
8.0.110.0040.00417.00
8.0.100.0020.00517.23
8.0.90.0000.00717.17
8.0.80.0030.01317.14
8.0.70.0040.00417.03
8.0.60.0040.00417.12
8.0.50.0000.00717.05
8.0.30.0120.00917.15
8.0.20.0160.00217.43
8.0.10.0040.00417.39
8.0.00.0100.01017.14
7.4.330.0050.00016.75
7.4.320.0000.00716.90
7.4.300.0030.00316.70
7.4.290.0040.00416.68
7.4.280.0030.00316.84
7.4.270.0000.00716.65
7.4.260.0030.00313.43
7.4.250.0040.00416.59
7.4.240.0030.00316.73
7.4.230.0030.00316.87
7.4.220.0070.01116.83
7.4.210.0070.01016.71
7.4.200.0030.00316.82
7.4.190.0030.00316.92
7.4.160.0100.00716.68
7.4.150.0100.00717.40
7.4.140.0100.00717.86
7.4.130.0150.00316.77
7.4.120.0070.01216.88
7.4.110.0100.01016.69
7.4.100.0090.00916.83
7.4.90.0150.00316.73
7.4.80.0150.00919.39
7.4.70.0030.01316.56
7.4.60.0090.00916.94
7.4.50.0060.00316.59
7.4.40.0040.00722.77
7.4.30.0030.01316.79
7.4.00.0060.00915.05
7.3.330.0050.00013.57
7.3.320.0050.00013.54
7.3.310.0070.00016.53
7.3.300.0030.00316.53
7.3.290.0070.00716.63
7.3.280.0110.00516.56
7.3.270.0060.01317.40
7.3.260.0170.00018.24
7.3.250.0050.01216.65
7.3.240.0140.00316.82
7.3.230.0090.00816.70
7.3.210.0060.01316.68
7.3.200.0090.01319.39
7.3.190.0100.01316.82
7.3.180.0090.00616.69
7.3.170.0080.00916.66
7.3.160.0070.01316.76
7.3.120.0020.01615.15
7.3.110.0140.00415.13
7.3.100.0100.00615.08
7.3.90.0050.00514.99
7.3.80.0030.01015.20
7.3.70.0000.01215.00
7.3.60.0090.00614.84
7.3.50.0030.01315.16
7.3.40.0040.01115.17
7.3.30.0000.01815.08
7.3.20.0100.00316.98
7.3.10.0080.00817.03
7.3.00.0090.00616.71
7.2.330.0180.00717.09
7.2.320.0070.01417.11
7.2.310.0040.01816.85
7.2.300.0110.00716.66
7.2.290.0090.00917.00
7.2.250.0030.01715.14
7.2.240.0110.01115.28
7.2.230.0090.00915.15
7.2.220.0100.00315.54
7.2.210.0100.00315.21
7.2.200.0040.01115.36
7.2.190.0040.01115.31
7.2.180.0060.00915.39
7.2.170.0060.01015.32
7.2.00.0030.01019.40
7.1.330.0070.01015.80
7.1.320.0030.01015.81
7.1.310.0000.01216.10
7.1.300.0040.01216.19
7.1.290.0030.00715.93
7.1.280.0090.00315.78
7.1.270.0060.00616.19
7.1.260.0090.00615.95
7.1.100.0000.01118.39
7.1.70.0040.00417.13
7.1.60.0140.01019.17
7.1.50.0100.01017.32
7.1.00.0000.03722.44
7.0.200.0000.00717.09
7.0.140.0030.07722.21
7.0.100.0230.04019.96
7.0.90.0100.04319.93
7.0.80.0100.03319.93
7.0.70.0070.04320.00
7.0.60.0130.07019.93
7.0.50.0100.04320.32
7.0.40.0000.06020.14
7.0.30.0130.06720.17
7.0.20.0100.03720.13
7.0.10.0100.05320.07
7.0.00.0100.04320.10
5.6.280.0070.07020.86
5.6.250.0030.04720.57
5.6.240.0000.04720.67
5.6.230.0030.04720.66
5.6.220.0130.03720.48
5.6.210.0100.07320.75
5.6.200.0100.03721.14
5.6.190.0030.04320.94
5.6.180.0070.03321.04
5.6.170.0030.04021.11
5.6.160.0070.04321.08
5.6.150.0100.08021.11
5.6.140.0070.04021.01
5.6.130.0070.04021.13
5.6.120.0030.04320.96
5.6.110.0000.04320.96
5.6.100.0030.03721.03
5.6.90.0100.05320.95
5.6.80.0070.04020.41
5.6.70.0030.08320.51
5.6.60.0070.06720.39
5.6.50.0030.05720.53
5.6.40.0100.07320.38
5.6.30.0100.07020.47
5.6.20.0130.07320.31
5.6.10.0030.06020.36
5.6.00.0130.07720.30
5.5.380.0070.06020.34
5.5.370.0030.04020.35
5.5.360.0230.05020.41
5.5.350.0100.05320.38
5.5.340.0000.04020.77
5.5.330.0100.06320.85
5.5.320.0030.04320.84
5.5.310.0070.06020.83
5.5.300.0030.04720.78
5.5.290.0070.06320.73
5.5.280.0000.04720.86
5.5.270.0070.05320.77
5.5.260.0000.04020.88
5.5.250.0030.03720.72
5.5.240.0030.04020.22
5.5.230.0100.03720.26
5.5.220.0100.07320.21
5.5.210.0070.07720.13
5.5.200.0130.07720.25
5.5.190.0070.07320.21
5.5.180.0100.06020.08
5.5.160.0030.05720.22
5.5.150.0030.06320.25
5.5.140.0070.08020.13
5.5.130.0100.04720.18
5.5.120.0100.06720.27
5.5.110.0170.05319.98
5.5.100.0070.07720.06
5.5.90.0070.07320.10
5.5.80.0100.07020.07
5.5.70.0170.07020.01
5.5.60.0030.05720.08
5.5.50.0030.08020.03
5.5.40.0070.07720.05
5.5.30.0130.07020.13
5.5.20.0170.05720.11
5.5.10.0030.08319.96
5.5.00.0030.08020.04
5.4.450.0100.04019.23
5.4.440.0000.04319.17
5.4.430.0100.05019.46
5.4.420.0070.03319.53
5.4.410.0070.03319.22
5.4.400.0100.06018.91
5.4.390.0170.07019.18
5.4.380.0100.06719.12
5.4.370.0100.07719.20
5.4.360.0100.07019.14
5.4.350.0030.08018.95
5.4.340.0170.05719.02
5.4.320.0000.08719.12
5.4.310.0130.06019.25
5.4.300.0030.08019.02
5.4.290.0130.07319.03
5.4.280.0100.07319.14
5.4.270.0000.08019.13
5.4.260.0030.08019.03
5.4.250.0070.05019.17
5.4.240.0030.07719.22
5.4.230.0000.04319.04
5.4.220.0170.07018.88
5.4.210.0070.04318.90
5.4.200.0070.08019.11
5.4.190.0030.07319.11
5.4.180.0100.05019.06
5.4.170.0100.07319.20
5.4.160.0070.06718.83
5.4.150.0230.06318.83
5.4.140.0070.07016.46
5.4.130.0030.05016.39
5.4.120.0030.07716.20
5.4.110.0070.03716.55
5.4.100.0100.06316.53
5.4.90.0030.06016.52
5.4.80.0030.04016.46
5.4.70.0070.07316.46
5.4.60.0000.04016.36
5.4.50.0100.06716.27
5.4.40.0000.07716.46
5.4.30.0130.04716.45
5.4.20.0100.06716.29
5.4.10.0100.07016.29
5.4.00.0070.07315.87
5.3.290.0100.06714.63
5.3.280.0000.07714.68
5.3.270.0130.04714.55
5.3.260.0100.07314.55
5.3.250.0070.04314.67
5.3.240.0070.07314.63
5.3.230.0170.06714.69
5.3.220.0070.07714.55
5.3.210.0100.04014.52
5.3.200.0070.03714.59
5.3.190.0000.08014.66
5.3.180.0100.06714.62
5.3.170.0000.06014.48
5.3.160.0100.06314.53
5.3.150.0100.07014.58
5.3.140.0170.05014.53
5.3.130.0100.08014.50
5.3.120.0130.06314.50
5.3.110.0100.07714.60
5.3.100.0130.04014.18
5.3.90.0070.07314.01
5.3.80.0000.08014.15
5.3.70.0130.07014.08
5.3.60.0100.06314.01
5.3.50.0070.07313.90
5.3.40.0070.04014.04
5.3.30.0100.04013.93
5.3.20.0000.05013.66
5.3.10.0100.05713.58
5.3.00.0100.05713.71
5.2.170.0070.04011.17
5.2.160.0070.03711.29
5.2.150.0030.05011.07
5.2.140.0030.05311.26
5.2.130.0030.06311.18
5.2.120.0100.05311.20
5.2.110.0100.05711.13
5.2.100.0070.03010.99
5.2.90.0130.05010.97
5.2.80.0070.06011.16
5.2.70.0030.06311.03
5.2.60.0100.06011.07
5.2.50.0070.04011.08
5.2.40.0070.06711.10
5.2.30.0070.06011.06
5.2.20.0030.03311.11
5.2.10.0000.06310.99
5.2.00.0030.05710.85
5.1.60.0100.05010.31
5.1.50.0000.06310.31
5.1.40.0100.04710.31
5.1.30.0030.05310.34
5.1.20.0070.05710.31
5.1.10.0070.05010.31
5.1.00.0100.05010.31
5.0.50.0000.05010.31
5.0.40.0030.02010.31
5.0.30.0030.06310.31
5.0.20.0070.03310.31
5.0.10.0030.04010.31
5.0.00.0000.05310.31
4.4.90.0000.03710.31
4.4.80.0030.03010.31
4.4.70.0070.03010.31
4.4.60.0070.03310.31
4.4.50.0100.02710.31
4.4.40.0070.04710.31
4.4.30.0030.03310.31
4.4.20.0000.04010.31
4.4.10.0000.03710.31
4.4.00.0030.05310.31
4.3.110.0000.01710.31
4.3.100.0070.03310.31
4.3.90.0070.03010.31
4.3.80.0030.05310.31
4.3.70.0000.03310.31
4.3.60.0070.03010.31
4.3.50.0030.03710.31
4.3.40.0030.05010.31
4.3.30.0000.03310.31
4.3.20.0000.04010.31
4.3.10.0070.03010.31
4.3.00.0000.03710.31

preferences:
41.71 ms | 401 KiB | 5 Q