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)); var_dump($i[3]); $month = -20; $days = floor($inbetween / 60 / 60 / 24); $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, 1391067556);

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.0100.00618.68
8.3.50.0060.00921.14
8.3.40.0040.01119.37
8.3.30.0070.00720.29
8.3.20.0050.00220.47
8.3.10.0040.00421.17
8.3.00.0080.00022.42
8.2.180.0090.00917.00
8.2.170.0110.00422.96
8.2.160.0120.00322.08
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0020.00526.16
8.2.120.0040.00421.06
8.2.110.0060.00319.16
8.2.100.0070.00418.22
8.2.90.0000.00819.52
8.2.80.0080.00018.18
8.2.70.0090.00018.00
8.2.60.0060.00318.18
8.2.50.0040.00418.07
8.2.40.0050.00318.34
8.2.30.0040.00419.50
8.2.20.0000.00818.05
8.2.10.0050.00318.14
8.2.00.0040.00418.07
8.1.280.0100.00325.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00624.05
8.1.230.0090.00321.09
8.1.220.0080.00018.77
8.1.210.0030.00619.02
8.1.200.0060.00317.60
8.1.190.0040.00417.79
8.1.180.0080.00018.10
8.1.170.0040.00418.95
8.1.160.0060.00319.02
8.1.150.0040.00418.89
8.1.140.0070.00017.79
8.1.130.0030.00317.99
8.1.120.0030.00617.80
8.1.110.0000.00817.65
8.1.100.0050.00217.68
8.1.90.0030.00517.72
8.1.80.0030.00317.70
8.1.70.0000.00717.69
8.1.60.0000.00917.80
8.1.50.0000.00817.71
8.1.40.0060.00317.81
8.1.30.0040.00417.89
8.1.20.0060.00317.91
8.1.10.0000.00817.83
8.1.00.0050.00217.70
8.0.300.0060.00319.90
8.0.290.0040.00417.18
8.0.280.0030.00318.75
8.0.270.0040.00417.46
8.0.260.0000.00717.08
8.0.250.0000.00717.31
8.0.240.0030.00617.22
8.0.230.0050.00317.29
8.0.220.0040.00417.12
8.0.210.0030.00517.21
8.0.200.0030.00317.27
8.0.190.0000.00817.35
8.0.180.0030.00417.27
8.0.170.0080.00017.23
8.0.160.0040.00417.19
8.0.150.0040.00417.23
8.0.140.0040.00417.12
8.0.130.0060.00013.48
8.0.120.0030.00517.05
8.0.110.0000.00717.13
8.0.100.0040.00417.25
8.0.90.0040.00417.20
8.0.80.0140.00417.27
8.0.70.0050.00317.11
8.0.60.0000.00717.29
8.0.50.0030.00417.17
8.0.30.0110.00917.48
8.0.20.0110.01217.48
8.0.10.0040.00417.41
8.0.00.0080.01016.94
7.4.330.0020.00216.94
7.4.320.0060.00016.77
7.4.300.0060.00016.87
7.4.290.0000.00816.79
7.4.280.0080.00016.79
7.4.270.0000.00716.84
7.4.260.0000.00613.45
7.4.250.0090.00016.77
7.4.240.0000.00716.79
7.4.230.0040.00416.96
7.4.220.0120.01117.00
7.4.210.0070.00916.85
7.4.200.0030.00317.00
7.4.190.0000.00616.96
7.4.160.0100.00716.83
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0050.01416.85
7.4.120.0070.01016.83
7.4.110.0070.01016.84
7.4.100.0100.01016.81
7.4.90.0090.01417.02
7.4.80.0070.01019.39
7.4.70.0060.01016.82
7.4.60.0000.01716.65
7.4.50.0080.00017.02
7.4.40.0030.01322.77
7.4.30.0040.01116.93
7.4.00.0090.00815.18
7.3.330.0000.00513.58
7.3.320.0030.00313.40
7.3.310.0060.00016.72
7.3.300.0040.00316.68
7.3.290.0070.01116.63
7.3.280.0100.00816.56
7.3.270.0100.00717.40
7.3.260.0220.00618.24
7.3.250.0110.00916.51
7.3.240.0000.01616.98
7.3.230.0170.00316.83
7.3.210.0040.01316.81
7.3.200.0120.00619.39
7.3.190.0070.01016.79
7.3.180.0080.00816.75
7.3.170.0120.01216.70
7.3.160.0060.01016.79
7.3.120.0060.01115.16
7.3.110.0070.01014.72
7.3.100.0120.00614.92
7.3.90.0070.01115.27
7.3.80.0130.00315.11
7.3.70.0040.01215.15
7.3.60.0070.01015.15
7.3.50.0100.00314.99
7.3.40.0040.01215.18
7.3.30.0000.01415.12
7.3.20.0000.01517.00
7.3.10.0030.01016.83
7.3.00.0080.00616.83
7.2.330.0120.00617.04
7.2.320.0160.00317.09
7.2.310.0070.01017.09
7.2.300.0100.00616.94
7.2.290.0060.01217.08
7.2.250.0030.01415.34
7.2.240.0210.00015.19
7.2.230.0060.00615.29
7.2.220.0000.01415.16
7.2.210.0000.01215.36
7.2.200.0030.00615.23
7.2.190.0090.00615.16
7.2.180.0090.00615.36
7.2.170.0000.00915.19
7.2.130.0000.01517.02
7.2.120.0040.00817.26
7.2.110.0080.00617.15
7.2.100.0040.00417.16
7.2.90.0000.01017.21
7.2.80.0000.01017.20
7.2.70.0040.00417.13
7.2.60.0070.00717.00
7.2.50.0030.00717.27
7.2.40.0070.00717.01
7.2.30.0060.00717.25
7.2.20.0050.00517.29
7.2.10.0070.00716.89
7.2.00.0080.00518.37
7.1.330.0000.01416.14
7.1.320.0070.00316.02
7.1.310.0030.01116.16
7.1.300.0140.00015.82
7.1.290.0030.01315.84
7.1.280.0060.00616.09
7.1.270.0030.00916.14
7.1.260.0070.00715.98
7.1.250.0030.00616.07
7.1.100.0090.00318.15
7.1.70.0000.00917.49
7.1.60.0070.01819.17
7.1.50.0040.01817.35
7.1.00.0030.03322.50
7.0.200.0000.00717.13
7.0.140.0030.07721.95
7.0.80.0070.08320.16
7.0.70.0200.07019.92
7.0.60.0130.07020.05
7.0.50.0130.05320.27
7.0.40.0100.08320.11
7.0.30.0070.07720.18
7.0.20.0030.05720.18
7.0.10.0030.05720.14
7.0.00.0130.04720.04
5.6.280.0030.07320.87
5.6.230.0130.08020.55
5.6.220.0130.07720.59
5.6.210.0070.05320.66
5.6.200.0170.08021.05
5.6.190.0100.08321.06
5.6.180.0070.08321.02
5.6.170.0030.07020.96
5.6.160.0030.05721.06
5.6.150.0100.03721.03
5.6.140.0100.03721.06
5.6.130.0100.03720.96
5.6.120.0070.03721.04
5.6.110.0100.03720.94
5.6.100.0100.06020.97
5.6.90.0070.04721.04
5.6.80.0030.04020.34
5.6.70.0030.07020.41
5.6.60.0070.03320.46
5.6.50.0070.04320.34
5.6.40.0100.03320.32
5.6.30.0070.04020.39
5.6.20.0000.04720.44
5.6.10.0100.03720.42
5.6.00.0070.06320.36
5.5.370.0030.09320.36
5.5.360.0030.09020.42
5.5.350.0030.08320.44
5.5.340.0070.08020.84
5.5.330.0130.07020.88
5.5.320.0100.04020.85
5.5.310.0070.07720.83
5.5.300.0070.04020.77
5.5.290.0000.04020.90
5.5.280.0070.04320.84
5.5.270.0070.05720.74
5.5.260.0000.04720.87
5.5.250.0000.06720.69
5.5.240.0000.05720.27
5.5.230.0000.04320.25
5.5.220.0070.03720.19
5.5.210.0030.04020.30
5.5.200.0070.03720.15
5.5.190.0130.07320.20
5.5.180.0030.04020.25
5.5.160.0070.03320.25
5.5.150.0030.04020.24
5.5.140.0000.04320.25
5.5.130.0030.04320.16
5.5.120.0070.08020.29
5.5.110.0030.06020.22
5.5.100.0070.03720.06
5.5.90.0070.03320.08
5.5.80.0100.03719.98
5.5.70.0070.04320.11
5.5.60.0070.03320.16
5.5.50.0070.03720.06
5.5.40.0000.04020.16
5.5.30.0030.04020.14
5.5.20.0100.08020.04
5.5.10.0130.03320.12
5.5.00.0070.07320.14
5.4.450.0000.04719.54
5.4.440.0030.04019.43
5.4.430.0070.07319.17
5.4.420.0030.05319.45
5.4.410.0030.03319.29
5.4.400.0000.07019.13
5.4.390.0070.04319.16
5.4.380.0070.03319.21
5.4.370.0000.04018.95
5.4.360.0070.04019.04
5.4.350.0030.05718.92
5.4.340.0000.04019.15
5.4.320.0070.03719.16
5.4.310.0030.03319.02
5.4.300.0030.04319.05
5.4.290.0030.04319.11
5.4.280.0030.04019.03
5.4.270.0000.04319.22
5.4.260.0030.03319.12
5.4.250.0030.03718.87
5.4.240.0070.03019.08
5.4.230.0070.03718.90
5.4.220.0030.03718.94
5.4.210.0000.04019.12
5.4.200.0070.03719.16
5.4.190.0030.04718.90
5.4.180.0030.06019.17
5.4.170.0100.07319.01
5.4.160.0030.05719.19
5.4.150.0100.04319.03
5.4.140.0030.07316.39
5.4.130.0100.07016.46
5.4.120.0030.04316.46
5.4.110.0130.06716.45
5.4.100.0100.07016.42
5.4.90.0170.06316.54
5.4.80.0070.07316.45
5.4.70.0100.07716.39
5.4.60.0070.05316.25
5.4.50.0100.07016.44
5.4.40.0070.04716.53
5.4.30.0070.07016.32
5.4.20.0130.06316.25
5.4.10.0070.04716.41
5.4.00.0100.04315.73
5.3.290.0000.03714.81
5.3.280.0030.03314.65
5.3.270.0100.06314.72
5.3.260.0000.08314.67
5.3.250.0030.07314.55
5.3.240.0100.07314.70
5.3.230.0070.07014.54
5.3.220.0030.04714.71
5.3.210.0070.04714.63
5.3.200.0070.05014.50
5.3.190.0070.07714.63
5.3.180.0070.04014.71
5.3.170.0100.07314.67
5.3.160.0070.07014.66
5.3.150.0030.07314.60
5.3.140.0170.07014.49
5.3.130.0100.07314.48
5.3.120.0130.07314.48
5.3.110.0030.08014.56
5.3.100.0130.06714.14
5.3.90.0000.08014.09
5.3.80.0100.07014.15
5.3.70.0070.08013.93
5.3.60.0000.08313.92
5.3.50.0070.07714.09
5.3.40.0030.07314.08
5.3.30.0030.04313.90
5.3.20.0070.07313.63
5.3.10.0070.05713.80
5.3.00.0100.06713.64
5.2.170.0030.04311.26
5.2.160.0070.03311.29
5.2.150.0030.04711.16
5.2.140.0070.02711.20
5.2.130.0030.05311.23
5.2.120.0100.05711.21
5.2.110.0070.06011.25
5.2.100.0070.04010.96
5.2.90.0170.05311.14
5.2.80.0100.06311.11
5.2.70.0170.05011.24
5.2.60.0070.05711.20
5.2.50.0100.06310.95
5.2.40.0000.05311.15
5.2.30.0100.05711.04
5.2.20.0100.05010.96
5.2.10.0070.05010.93
5.2.00.0100.05310.82
5.1.60.0070.04710.06
5.1.50.0030.0579.90
5.1.40.0000.05710.04
5.1.30.0030.05310.25
5.1.20.0000.05310.22
5.1.10.0030.0509.95
5.1.00.0030.05710.17
5.0.50.0030.0408.61
5.0.40.0030.0438.26
5.0.30.0030.0508.13
5.0.20.0000.0478.21
5.0.10.0130.0278.25
5.0.00.0030.0378.24
4.4.90.0000.0407.16
4.4.80.0000.0277.16
4.4.70.0000.0277.16
4.4.60.0030.0337.16
4.4.50.0000.0407.16
4.4.40.0030.0537.16
4.4.30.0030.0377.16
4.4.20.0070.0307.16
4.4.10.0030.0337.16
4.4.00.0030.0477.16
4.3.110.0070.0237.16
4.3.100.0030.0337.16
4.3.90.0030.0377.16
4.3.80.0000.0277.16
4.3.70.0000.0207.16
4.3.60.0000.0337.16
4.3.50.0000.0407.16
4.3.40.0070.0507.16
4.3.30.0030.0277.16
4.3.20.0030.0307.16
4.3.10.0000.0377.16
4.3.00.0030.0277.16

preferences:
43.31 ms | 400 KiB | 5 Q