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)); $i[4] = date('L', strtotime('-1 year', $second)) ? 366 : 365; $month = floor($inbetween / $i[0] / $i[0] / $i[1] / $i[3] % $i[4]); $days = floor($inbetween / $i[0] / $i[0] / $i[1] % $i[3]); $hours = floor($inbetween / $i[0] / $i[0] % $i[1]); $minutes = floor($inbetween / $i[0] % $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.0100.01018.55
8.3.50.0100.01321.14
8.3.40.0120.00619.04
8.3.30.0070.00720.29
8.3.20.0040.00420.14
8.3.10.0080.00021.14
8.3.00.0070.00022.51
8.2.180.0100.01017.13
8.2.170.0070.00722.96
8.2.160.0070.01022.27
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0000.00820.88
8.2.110.0080.00319.52
8.2.100.0000.01117.97
8.2.90.0060.00319.33
8.2.80.0040.00418.29
8.2.70.0030.00617.75
8.2.60.0030.00618.05
8.2.50.0000.00918.07
8.2.40.0000.00818.40
8.2.30.0040.00419.52
8.2.20.0040.00417.98
8.2.10.0000.00818.04
8.2.00.0040.00418.05
8.1.280.0070.01125.92
8.1.270.0080.00023.99
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0060.00324.09
8.1.230.0060.00620.75
8.1.220.0000.00918.77
8.1.210.0000.00819.09
8.1.200.0090.00017.47
8.1.190.0000.00817.54
8.1.180.0060.00318.10
8.1.170.0050.00318.65
8.1.160.0050.00219.00
8.1.150.0060.00318.89
8.1.140.0040.00417.72
8.1.130.0000.00717.89
8.1.120.0060.00317.62
8.1.110.0000.00717.73
8.1.100.0040.00417.66
8.1.90.0000.00717.71
8.1.80.0000.00817.77
8.1.70.0000.00717.76
8.1.60.0000.00917.83
8.1.50.0040.00417.76
8.1.40.0030.00517.61
8.1.30.0000.00917.75
8.1.20.0000.00817.86
8.1.10.0020.00517.81
8.1.00.0000.00717.79
8.0.300.0040.00420.03
8.0.290.0040.00417.28
8.0.280.0070.00018.51
8.0.270.0030.00317.33
8.0.260.0000.00816.97
8.0.250.0070.00017.14
8.0.240.0040.00417.26
8.0.230.0040.00417.11
8.0.220.0030.00317.13
8.0.210.0080.00017.04
8.0.200.0080.00017.19
8.0.190.0050.00217.19
8.0.180.0000.00817.19
8.0.170.0000.00717.18
8.0.160.0030.00317.20
8.0.150.0000.00717.02
8.0.140.0000.00717.19
8.0.130.0030.00313.54
8.0.120.0000.00817.12
8.0.110.0000.00717.18
8.0.100.0080.00017.26
8.0.90.0050.00217.24
8.0.80.0030.01317.20
8.0.70.0040.00417.27
8.0.60.0000.00717.05
8.0.50.0070.00017.21
8.0.30.0070.01217.26
8.0.20.0130.00517.40
8.0.10.0040.00417.41
8.0.00.0090.01117.04
7.4.330.0030.00316.95
7.4.320.0030.00316.75
7.4.300.0000.00716.81
7.4.290.0000.00716.76
7.4.280.0000.00716.70
7.4.270.0070.00016.65
7.4.260.0030.00513.37
7.4.250.0060.00316.76
7.4.240.0050.00216.74
7.4.230.0070.00016.89
7.4.220.0070.01416.93
7.4.210.0060.00916.81
7.4.200.0030.00316.63
7.4.190.0000.00716.96
7.4.160.0100.00617.02
7.4.150.0120.00417.40
7.4.140.0140.00317.86
7.4.130.0080.00816.69
7.4.120.0110.00616.75
7.4.110.0130.00316.59
7.4.100.0100.00716.79
7.4.90.0070.01016.79
7.4.80.0040.01819.39
7.4.70.0120.00416.94
7.4.60.0100.00716.87
7.4.50.0060.00316.90
7.4.40.0080.00622.77
7.4.30.0150.00016.63
7.4.00.0080.00415.21
7.3.330.0030.00313.58
7.3.320.0030.00313.53
7.3.310.0000.00716.43
7.3.300.0030.00316.41
7.3.290.0100.00316.60
7.3.280.0150.00216.62
7.3.270.0160.00017.40
7.3.260.0060.01218.24
7.3.250.0110.00716.75
7.3.240.0130.00616.50
7.3.230.0160.00616.59
7.3.210.0120.00616.52
7.3.200.0090.01019.39
7.3.190.0120.00616.56
7.3.180.0100.00616.80
7.3.170.0100.00616.62
7.3.160.0060.00916.77
7.3.120.0130.00315.08
7.3.10.0040.01116.94
7.3.00.0040.00616.87
7.2.330.0120.01217.09
7.2.320.0140.00716.87
7.2.310.0090.01317.07
7.2.300.0070.01016.80
7.2.290.0090.01216.81
7.2.130.0060.00617.09
7.2.120.0080.00617.01
7.2.110.0150.00617.06
7.2.100.0110.00217.05
7.2.90.0020.01317.14
7.2.80.0080.00517.08
7.2.70.0060.00517.31
7.2.60.0050.00617.12
7.2.50.0040.00917.30
7.2.40.0090.00616.99
7.2.30.0110.00417.11
7.2.20.0040.01117.05
7.2.10.0080.00617.19
7.2.00.0070.00817.69
7.1.250.0080.00416.04
7.1.240.0100.00315.79
7.1.230.0070.00715.84
7.1.220.0030.01315.89
7.1.210.0100.00315.92
7.1.200.0000.01316.09
7.1.190.0060.00816.08
7.1.180.0090.00615.82
7.1.170.0070.00415.93
7.1.160.0100.00316.10
7.1.150.0000.01116.07
7.1.140.0060.00916.04
7.1.130.0100.00616.04
7.1.120.0090.00016.00
7.1.110.0030.01016.05
7.1.100.0070.00817.40
7.1.90.0070.00716.10
7.1.80.0060.00616.12
7.1.70.0050.01016.58
7.1.60.0030.00916.64
7.1.50.0160.01224.60
7.1.40.0090.00016.03
7.1.30.0060.00615.75
7.1.20.0000.00816.11
7.1.10.0030.00615.97
7.1.00.0000.03219.17
7.0.330.0100.00315.56
7.0.320.0000.00915.56
7.0.310.0100.00315.46
7.0.300.0100.00315.55
7.0.290.0060.00615.62
7.0.280.0000.00915.60
7.0.270.0040.01115.57
7.0.260.0040.00815.61
7.0.250.0000.01115.68
7.0.240.0060.00815.32
7.0.230.0070.00715.77
7.0.220.0000.01115.50
7.0.210.0070.00715.46
7.0.200.0020.01216.19
7.0.190.0070.00715.52
7.0.180.0040.00815.45
7.0.170.0040.00815.68
7.0.160.0030.01015.54
7.0.150.0060.00615.23
7.0.140.0030.04218.77
7.0.130.0080.00415.61
7.0.120.0040.00415.73
7.0.110.0120.00015.66
7.0.100.0020.04317.75
7.0.90.0150.04317.81
7.0.80.0030.03017.76
7.0.70.0040.02717.78
7.0.60.0030.02517.61
7.0.50.0020.02717.97
7.0.40.0050.02316.85
7.0.30.0050.04016.84
7.0.20.0140.02016.77
7.0.10.0060.04616.76
7.0.00.0040.03716.89
5.6.380.0060.01014.57
5.6.370.0040.00714.41
5.6.360.0110.00414.63
5.6.350.0040.00714.42
5.6.340.0060.01014.68
5.6.330.0040.00414.67
5.6.320.0070.00714.68
5.6.310.0030.01014.68
5.6.300.0060.00314.41
5.6.290.0000.01014.89
5.6.280.0060.03817.80
5.6.270.0100.00714.46
5.6.260.0060.00314.98
5.6.250.0050.04117.62
5.6.240.0030.03017.68
5.6.230.0050.02517.60
5.6.220.0110.02017.55
5.6.210.0100.03217.39
5.6.200.0090.03817.70
5.6.190.0050.03117.82
5.6.180.0060.03317.84
5.6.170.0100.03817.59
5.6.160.0100.04317.81
5.6.150.0100.02417.84
5.6.140.0040.04417.69
5.6.130.0030.04017.96
5.6.120.0080.03017.77
5.6.110.0070.04517.80
5.6.100.0050.02818.00
5.6.90.0040.03717.63
5.6.80.0070.03017.58
5.6.70.0030.03617.53
5.6.60.0020.02917.53
5.6.50.0020.04117.65
5.6.40.0080.04217.48
5.6.30.0070.02917.39
5.6.20.0030.02817.56
5.6.10.0070.02017.39
5.6.00.0030.02417.39
5.5.380.0080.03615.77
5.5.370.0070.04215.99
5.5.360.0020.02815.96
5.5.350.0060.03815.74
5.5.340.0050.04816.28
5.5.330.0130.03816.16
5.5.320.0030.03816.06
5.5.310.0050.04516.02
5.5.300.0090.03316.19
5.5.290.0050.04916.12
5.5.280.0050.03516.18
5.5.270.0080.03816.07
5.5.260.0100.03616.07
5.5.250.0060.02016.04
5.5.240.0060.04315.78
5.5.230.0050.02015.64
5.5.220.0030.04415.69
5.5.210.0050.02815.67
5.5.200.0020.03415.67
5.5.190.0150.03515.72
5.5.180.0020.04015.68
5.5.170.0030.00911.46
5.5.160.0030.02115.77
5.5.150.0070.02015.70
5.5.140.0030.02715.87
5.5.130.0100.01715.71
5.5.120.0030.03015.80
5.5.110.0000.02715.68
5.5.100.0030.02115.62
5.5.90.0080.02015.75
5.5.80.0100.01815.63
5.5.70.0050.01915.75
5.5.60.0050.03715.62
5.5.50.0070.03715.61
5.5.40.0030.02215.59
5.5.30.0050.01915.72
5.5.20.0020.03415.64
5.5.10.0060.01915.62
5.5.00.0030.02215.66
5.4.450.0080.02515.49
5.4.440.0080.03715.43
5.4.430.0030.02715.43
5.4.420.0060.04115.40
5.4.410.0040.04315.14
5.4.400.0000.03115.32
5.4.390.0070.04215.22
5.4.380.0000.05315.25
5.4.370.0030.02115.36
5.4.360.0020.04315.13
5.4.350.0070.03915.30
5.4.340.0090.01715.34
5.4.330.0070.00311.20
5.4.320.0020.02415.30
5.4.310.0080.01615.07
5.4.300.0070.01715.26
5.4.290.0030.02315.21
5.4.280.0060.02115.28
5.4.270.0000.02515.18
5.4.260.0030.02315.09
5.4.250.0020.02215.20
5.4.240.0050.02115.15
5.4.230.0050.02715.27
5.4.220.0050.03815.09
5.4.210.0070.03515.16
5.4.200.0060.03615.11
5.4.190.0050.03115.16
5.4.180.0050.02015.25
5.4.170.0080.01715.26
5.4.160.0040.03215.18
5.4.150.0070.03115.10
5.4.140.0050.04413.93
5.4.130.0030.02213.68
5.4.120.0000.02613.94
5.4.110.0020.04413.92
5.4.100.0050.02013.82
5.4.90.0000.02413.89
5.4.80.0070.01513.80
5.4.70.0050.02113.96
5.4.60.0030.02213.83
5.4.50.0060.02113.92
5.4.40.0060.02013.84
5.4.30.0040.02013.95
5.4.20.0030.02213.83
5.4.10.0040.02213.80
5.4.00.0100.01313.59
5.3.290.0050.02112.97
5.3.280.0100.02712.87
5.3.270.0040.02212.86
5.3.260.0030.03012.96
5.3.250.0050.01812.94
5.3.240.0020.02212.89
5.3.230.0080.03012.95
5.3.220.0030.03012.93
5.3.210.0080.02612.88
5.3.200.0040.02912.86
5.3.190.0050.02012.86
5.3.180.0070.01812.87
5.3.170.0030.02212.93
5.3.160.0100.02012.84
5.3.150.0030.02412.86
5.3.140.0030.02212.93
5.3.130.0050.01812.86
5.3.120.0020.02212.93
5.3.110.0070.02912.83
5.3.100.0030.02112.62
5.3.90.0060.02012.59
5.3.80.0060.01712.60
5.3.70.0030.02012.65
5.3.60.0020.02312.59
5.3.50.0030.02212.53
5.3.40.0030.02212.58
5.3.30.0060.01712.57
5.3.20.0050.01712.51
5.3.10.0030.02312.38
5.3.00.0040.03012.46
5.2.170.0020.01911.21
5.2.160.0030.01811.20
5.2.150.0000.01911.12
5.2.140.0020.01811.23
5.2.130.0040.01711.07
5.2.120.0070.02511.20
5.2.110.0020.02911.20
5.2.100.0060.01611.14
5.2.90.0050.01311.16
5.2.80.0020.01511.20
5.2.70.0050.01511.14
5.2.60.0050.01511.19
5.2.50.0030.02311.11
5.2.40.0000.01811.10
5.2.30.0040.01511.01
5.2.20.0050.02111.11
5.2.10.0040.01511.00
5.2.00.0000.01711.01
5.1.60.0060.01510.62
5.1.50.0040.01410.61
5.1.40.0020.01610.62
5.1.30.0030.01510.79
5.1.20.0000.01610.80
5.1.10.0020.02010.66
5.1.00.0060.02010.63
5.0.50.0030.0259.87
5.0.40.0000.0159.84
5.0.30.0020.0329.72
5.0.20.0020.0269.74
5.0.10.0030.0179.73
5.0.00.0100.0289.73
4.4.90.0030.0088.89
4.4.80.0020.0128.89
4.4.70.0040.0078.89
4.4.60.0020.0108.89
4.4.50.0020.0098.89
4.4.40.0000.0178.89
4.4.30.0000.0178.89
4.4.20.0070.0178.89
4.4.10.0020.0158.89
4.4.00.0050.0188.89
4.3.110.0030.0128.89
4.3.100.0020.0208.89
4.3.90.0050.0168.89
4.3.80.0050.0268.89
4.3.70.0000.0158.89
4.3.60.0020.0208.89
4.3.50.0030.0188.89
4.3.40.0030.0288.89
4.3.30.0000.0178.89
4.3.20.0020.0228.89
4.3.10.0050.0138.89
4.3.00.0020.0208.89

preferences:
42.78 ms | 401 KiB | 5 Q