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; $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(1388389156, 1388392817);

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.0170.00318.55
8.3.50.0140.00521.09
8.3.40.0040.01418.89
8.3.30.0100.00320.33
8.3.20.0000.00820.33
8.3.10.0070.00021.08
8.3.00.0040.00422.39
8.2.180.0000.01516.88
8.2.170.0110.00422.96
8.2.160.0070.00722.21
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0140.00026.16
8.2.120.0000.00820.79
8.2.110.0140.00320.52
8.2.100.0060.00617.97
8.2.90.0030.00619.30
8.2.80.0030.00518.15
8.2.70.0030.00517.75
8.2.60.0000.00818.03
8.2.50.0060.00318.07
8.2.40.0040.00418.21
8.2.30.0050.00219.58
8.2.20.0040.00417.70
8.2.10.0040.00417.87
8.2.00.0030.00517.71
8.1.280.0070.01025.92
8.1.270.0080.00023.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0070.00324.00
8.1.230.0120.00020.95
8.1.220.0030.00618.77
8.1.210.0040.00819.22
8.1.200.0040.00417.25
8.1.190.0030.00617.55
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0000.00718.85
8.1.150.0050.00318.69
8.1.140.0040.00417.51
8.1.130.0030.00317.88
8.1.120.0050.00317.49
8.1.110.0000.00717.50
8.1.100.0050.00217.56
8.1.90.0040.00417.51
8.1.80.0030.00317.58
8.1.70.0030.00317.43
8.1.60.0040.00417.49
8.1.50.0080.00017.60
8.1.40.0040.00417.46
8.1.30.0040.00417.69
8.1.20.0060.00317.54
8.1.10.0070.00417.63
8.1.00.0080.00017.58
8.0.300.0050.00320.02
8.0.290.0000.00717.05
8.0.280.0000.00718.38
8.0.270.0030.00317.18
8.0.260.0030.00316.84
8.0.250.0030.00317.00
8.0.240.0000.00716.98
8.0.230.0060.00317.05
8.0.220.0090.00016.98
8.0.210.0030.00316.92
8.0.200.0060.00016.99
8.0.190.0090.00017.05
8.0.180.0050.00316.87
8.0.170.0040.00416.92
8.0.160.0030.00316.82
8.0.150.0000.00716.79
8.0.140.0000.00716.95
8.0.130.0030.00313.34
8.0.120.0000.00716.88
8.0.110.0000.00716.90
8.0.100.0040.00416.80
8.0.90.0000.00717.06
8.0.80.0120.00916.90
8.0.70.0070.00016.84
8.0.60.0030.00616.94
8.0.50.0070.00016.80
8.0.30.0090.00917.27
8.0.20.0090.00917.40
8.0.10.0050.00217.14
8.0.00.0110.00716.95
7.4.330.0050.00016.74
7.4.320.0000.00816.59
7.4.300.0030.00316.57
7.4.290.0000.00716.69
7.4.280.0030.00316.67
7.4.270.0030.00316.54
7.4.260.0040.00413.33
7.4.250.0050.00316.70
7.4.240.0030.00416.53
7.4.230.0000.00716.63
7.4.220.0110.00716.49
7.4.210.0090.00616.62
7.4.200.0030.00316.47
7.4.190.0000.00716.75
7.4.160.0100.00616.55
7.4.150.0060.01217.40
7.4.140.0100.00917.86
7.4.130.0060.01416.54
7.4.120.0070.01016.58
7.4.110.0150.00416.62
7.4.100.0030.01716.37
7.4.90.0220.00016.55
7.4.80.0120.00919.39
7.4.70.0130.00316.65
7.4.60.0100.00716.60
7.4.50.0070.00016.43
7.4.40.0050.00622.77
7.4.30.0060.00916.44
7.4.00.0000.01515.11
7.3.330.0020.00213.44
7.3.320.0030.00313.38
7.3.310.0000.00716.45
7.3.300.0070.00016.31
7.3.290.0060.00916.37
7.3.280.0080.00716.42
7.3.270.0110.00617.40
7.3.260.0110.01518.24
7.3.250.0070.01016.66
7.3.240.0060.00916.64
7.3.230.0090.00916.67
7.3.210.0110.00616.34
7.3.200.0130.01019.39
7.3.190.0090.00616.76
7.3.180.0110.01116.37
7.3.170.0000.01716.54
7.3.160.0070.01016.42
7.3.120.0090.00614.85
7.2.330.0090.00916.70
7.2.320.0060.01216.89
7.2.310.0140.00416.87
7.2.300.0100.00716.95
7.2.290.0130.00316.90
7.2.00.0080.00819.38
7.1.100.0280.00317.25
7.1.70.0090.00317.17
7.1.60.0130.01019.17
7.1.50.0000.02116.68
7.1.00.0030.03722.54
7.0.200.0000.00716.87
7.0.140.0000.07722.23
7.0.100.0100.08719.96
7.0.90.0170.07320.18
7.0.80.0070.08019.96
7.0.70.0070.05019.92
7.0.60.0030.06019.82
7.0.50.0070.06320.16
7.0.40.0130.07320.09
7.0.30.0030.06320.18
7.0.20.0070.07020.18
7.0.10.0170.07720.07
7.0.00.0130.07720.04
5.6.280.0130.06321.12
5.6.250.0100.07720.63
5.6.240.0130.07020.64
5.6.230.0170.07320.63
5.6.220.0030.08720.64
5.6.210.0070.05020.49
5.6.200.0100.07721.14
5.6.190.0100.08021.04
5.6.180.0030.04320.94
5.6.170.0130.04321.08
5.6.160.0100.08721.00
5.6.150.0130.08021.11
5.6.140.0100.07721.08
5.6.130.0030.07321.11
5.6.120.0170.06721.01
5.6.110.0130.07720.96
5.6.100.0130.07720.95
5.6.90.0130.07720.99
5.6.80.0100.07020.45
5.6.70.0030.08020.32
5.6.60.0130.07020.40
5.6.50.0030.06720.56
5.6.40.0100.07720.38
5.6.30.0030.08720.41
5.6.20.0100.07320.52
5.6.10.0130.04720.44
5.6.00.0070.08320.35
5.5.380.0030.07020.42
5.5.370.0100.04020.36
5.5.360.0030.08320.35
5.5.350.0070.08020.42
5.5.340.0170.06320.80
5.5.330.0100.07320.89
5.5.320.0170.06720.78
5.5.310.0170.05020.73
5.5.300.0170.06720.89
5.5.290.0070.06020.87
5.5.280.0030.05020.62
5.5.270.0100.04720.77
5.5.260.0100.08020.77
5.5.250.0070.07720.54
5.5.240.0130.07720.27
5.5.230.0030.07720.27
5.5.220.0070.06020.18
5.5.210.0230.06020.28
5.5.200.0200.06320.13
5.5.190.0030.08020.11
5.5.180.0070.03720.15
5.5.160.0000.09020.21
5.5.150.0070.08020.27
5.5.140.0070.08019.96
5.5.130.0170.07020.07
5.5.120.0070.07020.17
5.5.110.0030.08720.20
5.5.100.0070.06320.16
5.5.90.0070.06720.04
5.5.80.0130.06719.95
5.5.70.0030.05020.14
5.5.60.0100.04320.02
5.5.50.0000.08720.09
5.5.40.0030.05020.09
5.5.30.0100.07720.05
5.5.20.0130.07320.13
5.5.10.0070.07720.02
5.5.00.0100.07020.05
5.4.450.0030.05019.55
5.4.440.0100.07719.36
5.4.430.0070.08019.32
5.4.420.0170.07019.22
5.4.410.0170.07019.43
5.4.400.0070.06019.21
5.4.390.0100.07319.13
5.4.380.0230.06019.04
5.4.370.0030.06319.20
5.4.360.0100.03319.18
5.4.350.0170.06719.13
5.4.340.0030.08019.13
5.4.320.0000.08319.05
5.4.310.0070.03718.91
5.4.300.0070.07719.12
5.4.290.0100.07719.13
5.4.280.0200.03318.84
5.4.270.0030.06019.23
5.4.260.0130.03719.02
5.4.250.0030.07319.03
5.4.240.0030.07719.15
5.4.230.0130.06319.09
5.4.220.0030.08019.18
5.4.210.0100.04319.13
5.4.200.0070.07019.23
5.4.190.0100.06319.04
5.4.180.0070.07018.89
5.4.170.0200.06719.15
5.4.160.0000.08319.19
5.4.150.0030.05019.10
5.4.140.0030.06716.41
5.4.130.0070.07716.45
5.4.120.0030.04016.34
5.4.110.0030.04016.49
5.4.100.0030.07716.34
5.4.90.0130.03716.32
5.4.80.0000.07716.30
5.4.70.0070.07316.30
5.4.60.0130.06316.48
5.4.50.0030.07716.44
5.4.40.0070.04016.45
5.4.30.0030.07716.39
5.4.20.0070.03316.39
5.4.10.0030.07716.40
5.4.00.0070.07315.86
5.3.290.0070.06714.69
5.3.280.0070.07014.62
5.3.270.0100.06714.53
5.3.260.0130.06714.66
5.3.250.0070.07014.64
5.3.240.0100.06014.63
5.3.230.0100.07014.63
5.3.220.0070.07714.53
5.3.210.0070.04714.70
5.3.200.0030.08014.63
5.3.190.0030.07714.72
5.3.180.0100.06714.54
5.3.170.0070.07714.54
5.3.160.0030.08014.58
5.3.150.0070.07714.53
5.3.140.0070.06014.64
5.3.130.0030.05314.48
5.3.120.0070.07314.66
5.3.110.0100.07314.46
5.3.100.0070.07714.09
5.3.90.0070.08014.03
5.3.80.0030.05713.90
5.3.70.0100.07014.08
5.3.60.0070.07314.11
5.3.50.0070.07313.95
5.3.40.0070.05713.95
5.3.30.0070.07313.84
5.3.20.0030.07713.57
5.3.10.0100.07013.63
5.3.00.0070.07013.56
5.2.170.0070.03713.11
5.2.160.0200.04713.11
5.2.150.0100.03313.11
5.2.140.0070.06313.11
5.2.130.0170.05013.11
5.2.120.0000.06013.11
5.2.110.0070.06313.11
5.2.100.0100.06313.11
5.2.90.0070.04013.11
5.2.80.0030.05313.11
5.2.70.0070.06013.11
5.2.60.0100.05313.11
5.2.50.0100.04013.11
5.2.40.0030.06313.11
5.2.30.0030.06313.11
5.2.20.0070.05713.11
5.2.10.0100.06013.11
5.2.00.0070.04713.11
5.1.60.0030.03013.11
5.1.50.0070.04713.11
5.1.40.0070.04713.11
5.1.30.0100.05013.11
5.1.20.0130.05013.11
5.1.10.0130.05013.11
5.1.00.0030.05313.11
5.0.50.0070.03713.11
5.0.40.0100.03013.11
5.0.30.0070.06013.11
5.0.20.0030.02313.11
5.0.10.0030.04013.11
5.0.00.0030.03013.11
4.4.90.0070.02713.11
4.4.80.0030.03313.11
4.4.70.0030.03713.11
4.4.60.0000.02013.11
4.4.50.0000.03313.11
4.4.40.0030.02313.11
4.4.30.0070.03013.11
4.4.20.0000.04013.11
4.4.10.0030.03713.11
4.4.00.0000.03313.11
4.3.110.0000.03713.11
4.3.100.0030.02713.11
4.3.90.0100.02713.11
4.3.80.0070.03713.11
4.3.70.0030.03313.11
4.3.60.0030.02713.11
4.3.50.0030.03313.11
4.3.40.0030.04313.11
4.3.30.0030.02713.11
4.3.20.0000.03713.11
4.3.10.0000.02713.11
4.3.00.0000.04313.11

preferences:
51.4 ms | 401 KiB | 5 Q