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('-2 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.0080.00818.68
8.3.50.0090.00722.07
8.3.40.0150.00019.16
8.3.30.0120.00319.04
8.3.20.0030.00620.41
8.3.10.0040.00423.54
8.3.00.0050.00320.93
8.2.180.0100.01018.31
8.2.170.0110.00722.96
8.2.160.0070.00720.49
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00619.61
8.2.110.0070.00421.17
8.2.100.0080.00418.22
8.2.90.0030.00618.34
8.2.80.0060.00317.97
8.2.70.0080.00317.88
8.2.60.0040.00718.05
8.2.50.0000.00918.07
8.2.40.0040.00420.20
8.2.30.0000.00718.58
8.2.20.0030.00518.09
8.2.10.0070.00018.30
8.2.00.0040.00418.14
8.1.280.0100.01025.92
8.1.270.0090.00023.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.79
8.1.230.0080.00320.97
8.1.220.0040.00417.91
8.1.210.0000.00819.01
8.1.200.0080.00417.60
8.1.190.0030.00617.60
8.1.180.0040.00418.10
8.1.170.0050.00318.74
8.1.160.0040.00422.16
8.1.150.0040.00418.84
8.1.140.0040.00417.85
8.1.130.0070.00019.78
8.1.120.0050.00317.82
8.1.110.0000.00917.84
8.1.100.0050.00217.66
8.1.90.0000.00817.80
8.1.80.0030.00417.79
8.1.70.0000.00717.77
8.1.60.0030.00617.91
8.1.50.0000.00817.76
8.1.40.0000.00717.77
8.1.30.0030.00617.93
8.1.20.0000.00917.86
8.1.10.0040.00417.76
8.1.00.0000.00817.81
8.0.300.0040.00420.15
8.0.290.0030.00517.00
8.0.280.0000.00718.70
8.0.270.0030.00317.43
8.0.260.0030.00317.48
8.0.250.0000.00717.34
8.0.240.0040.00417.20
8.0.230.0000.00717.30
8.0.220.0070.00017.30
8.0.210.0000.00717.23
8.0.200.0070.00217.35
8.0.190.0080.00017.30
8.0.180.0080.00017.29
8.0.170.0030.00617.32
8.0.160.0070.00017.27
8.0.150.0000.01217.18
8.0.140.0000.00917.18
8.0.130.0000.00513.59
8.0.120.0040.00417.20
8.0.110.0050.00317.18
8.0.100.0050.00217.35
8.0.90.0040.00417.09
8.0.80.0060.01517.22
8.0.70.0030.00517.17
8.0.60.0000.00717.06
8.0.50.0000.00717.30
8.0.30.0100.00917.47
8.0.20.0110.00717.44
8.0.10.0040.00417.32
8.0.00.0140.00516.94
7.4.330.0000.00515.15
7.4.320.0000.00616.93
7.4.300.0020.00516.70
7.4.290.0040.00416.89
7.4.280.0030.00616.88
7.4.270.0000.00716.79
7.4.260.0070.00016.91
7.4.250.0040.00416.91
7.4.240.0050.00216.90
7.4.230.0040.00416.90
7.4.220.0140.00316.98
7.4.210.0100.01016.82
7.4.200.0040.00416.69
7.4.160.0080.00816.90
7.4.150.0150.00317.40
7.4.140.0070.01317.86
7.4.130.0090.01016.78
7.4.120.0090.00916.73
7.4.110.0100.00716.96
7.4.100.0180.00016.89
7.4.90.0050.01316.91
7.4.80.0060.01919.39
7.4.70.0100.00616.93
7.4.60.0090.01216.77
7.4.50.0000.00917.07
7.4.40.0060.01116.96
7.4.30.0060.00916.94
7.4.00.0100.00715.04
7.3.330.0000.00513.46
7.3.320.0050.00013.61
7.3.310.0070.00016.53
7.3.300.0040.00416.68
7.3.290.0060.01216.54
7.3.280.0100.00616.59
7.3.270.0120.00617.40
7.3.260.0070.01116.67
7.3.250.0120.00516.85
7.3.240.0170.00416.87
7.3.230.0160.01016.71
7.3.210.0120.00616.90
7.3.200.0050.01019.39
7.3.190.0090.01316.72
7.3.180.0090.00616.75
7.3.170.0070.01016.70
7.3.160.0090.00916.84
7.3.120.0110.00014.88
7.2.330.0100.00616.93
7.2.320.0070.01016.83
7.2.310.0090.00917.09
7.2.300.0160.00616.63
7.2.290.0230.01016.86
7.2.60.0040.01117.21
7.2.00.0060.00919.84
7.1.200.0080.00516.07
7.1.100.0030.00918.54
7.1.70.0030.00617.43
7.1.60.0070.01419.70
7.1.50.0110.01416.94
7.1.00.0070.07322.31
7.0.200.0030.00316.88
7.0.140.0030.07322.22
7.0.100.0100.08719.96
7.0.90.0070.07719.97
7.0.80.0100.08319.88
7.0.70.0100.08019.96
7.0.60.0070.09019.89
7.0.50.0070.07320.36
7.0.40.0100.08320.13
7.0.30.0100.08020.11
7.0.20.0100.03720.09
7.0.10.0070.07719.95
7.0.00.0000.06020.13
5.6.280.0100.06721.09
5.6.250.0070.08020.61
5.6.240.0030.08020.62
5.6.230.0000.07720.64
5.6.220.0070.05320.71
5.6.210.0000.04320.65
5.6.200.0130.07721.05
5.6.190.0100.04321.09
5.6.180.0100.07720.97
5.6.170.0030.08721.09
5.6.160.0030.04321.02
5.6.150.0100.05721.18
5.6.140.0070.08721.02
5.6.130.0100.07721.08
5.6.120.0100.08721.03
5.6.110.0130.07721.04
5.6.100.0070.06021.08
5.6.90.0170.07321.10
5.6.80.0130.08020.43
5.6.70.0030.08320.56
5.6.60.0070.05320.54
5.6.50.0030.08320.57
5.6.40.0170.06720.40
5.6.30.0100.07320.32
5.6.20.0030.07720.32
5.6.10.0130.06720.39
5.6.00.0000.05720.43
5.5.380.0030.04320.52
5.5.370.0070.07320.35
5.5.360.0100.07320.34
5.5.350.0030.04720.44
5.5.340.0070.06320.88
5.5.330.0270.06720.94
5.5.320.0130.04320.93
5.5.310.0130.06320.77
5.5.300.0170.07720.94
5.5.290.0070.05020.84
5.5.280.0200.07320.89
5.5.270.0170.05320.90
5.5.260.0130.08020.89
5.5.250.0030.06720.70
5.5.240.0030.05320.16
5.5.230.0130.04020.20
5.5.220.0030.05020.22
5.5.210.0170.06020.26
5.5.200.0030.05020.16
5.5.190.0070.06720.25
5.5.180.0100.05720.10
5.5.160.0030.04720.29
5.5.150.0130.05320.29
5.5.140.0030.04720.22
5.5.130.0100.05320.11
5.5.120.0100.07020.18
5.5.110.0000.06720.09
5.5.100.0030.08720.18
5.5.90.0070.08320.08
5.5.80.0100.07320.07
5.5.70.0030.05019.95
5.5.60.0200.04320.16
5.5.50.0070.06320.11
5.5.40.0070.07319.97
5.5.30.0170.03320.01
5.5.20.0030.08720.11
5.5.10.0030.08020.13
5.5.00.0070.07719.98
5.4.450.0100.08019.36
5.4.440.0170.04719.57
5.4.430.0170.06719.41
5.4.420.0070.07019.48
5.4.410.0100.08019.24
5.4.400.0100.09018.88
5.4.390.0100.06318.85
5.4.380.0030.05719.12
5.4.370.0070.07019.23
5.4.360.0130.07319.23
5.4.350.0070.05719.03
5.4.340.0000.07319.12
5.4.320.0000.07319.24
5.4.310.0030.05719.18
5.4.300.0030.03719.18
5.4.290.0030.08319.04
5.4.280.0070.04719.18
5.4.270.0030.07318.94
5.4.260.0070.07718.88
5.4.250.0070.04319.08
5.4.240.0130.07019.23
5.4.230.0070.07319.08
5.4.220.0030.08018.89
5.4.210.0200.06719.02
5.4.200.0100.05019.13
5.4.190.0100.04318.93
5.4.180.0230.06019.23
5.4.170.0030.08019.03
5.4.160.0170.06719.01
5.4.150.0070.05718.94
5.4.140.0000.08316.50
5.4.130.0030.08316.45
5.4.120.0130.07016.54
5.4.110.0100.04016.56
5.4.100.0070.06016.44
5.4.90.0100.06716.51
5.4.80.0100.05016.54
5.4.70.0070.07316.47
5.4.60.0170.06716.47
5.4.50.0200.06316.24
5.4.40.0000.08316.29
5.4.30.0100.04316.41
5.4.20.0070.07316.48
5.4.10.0030.04716.41
5.4.00.0100.06715.77
5.3.290.0030.03714.73
5.3.280.0070.07714.55
5.3.270.0100.07014.61
5.3.260.0070.07314.58
5.3.250.0070.07014.61
5.3.240.0030.08014.60
5.3.230.0070.08014.57
5.3.220.0100.07014.71
5.3.210.0170.06714.61
5.3.200.0130.07014.59
5.3.190.0070.08014.61
5.3.180.0170.06314.70
5.3.170.0070.07714.54
5.3.160.0100.06014.63
5.3.150.0100.04714.64
5.3.140.0100.07014.53
5.3.130.0000.06714.69
5.3.120.0170.07014.63
5.3.110.0000.08314.48
5.3.100.0030.04714.03
5.3.90.0030.04314.02
5.3.80.0130.07013.96
5.3.70.0200.03014.04
5.3.60.0170.05314.02
5.3.50.0100.05014.11
5.3.40.0030.08013.98
5.3.30.0170.05313.96
5.3.20.0070.07313.62
5.3.10.0070.06713.71
5.3.00.0130.07013.65
5.2.170.0070.04711.24
5.2.160.0030.06311.27
5.2.150.0100.06011.21
5.2.140.0070.06311.20
5.2.130.0030.06311.06
5.2.120.0100.05711.17
5.2.110.0070.06311.23
5.2.100.0030.05011.20
5.2.90.0100.03711.13
5.2.80.0100.06011.03
5.2.70.0100.05010.96
5.2.60.0070.05711.00
5.2.50.0000.07011.04
5.2.40.0130.04710.91
5.2.30.0130.05010.84
5.2.20.0070.04710.88
5.2.10.0000.04010.80
5.2.00.0030.05710.64
5.1.60.0000.04710.11
5.1.50.0070.03010.07
5.1.40.0000.0309.87
5.1.30.0030.06010.36
5.1.20.0030.04710.26
5.1.10.0070.04710.17
5.1.00.0070.0539.97
5.0.50.0000.0478.68
5.0.40.0130.0338.50
5.0.30.0030.0478.34
5.0.20.0030.0438.21
5.0.10.0100.0238.17
5.0.00.0000.0508.01
4.4.90.0030.0377.08
4.4.80.0000.0277.08
4.4.70.0070.0307.08
4.4.60.0030.0177.08
4.4.50.0000.0377.08
4.4.40.0030.0537.08
4.4.30.0000.0207.08
4.4.20.0070.0307.08
4.4.10.0000.0377.08
4.4.00.0070.0437.08
4.3.110.0000.0337.08
4.3.100.0000.0307.08
4.3.90.0100.0237.08
4.3.80.0030.0307.08
4.3.70.0070.0307.08
4.3.60.0030.0337.08
4.3.50.0030.0277.08
4.3.40.0000.0537.08
4.3.30.0000.0407.08
4.3.20.0030.0337.08
4.3.10.0000.0277.08
4.3.00.0070.0277.08

preferences:
47.86 ms | 401 KiB | 5 Q