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 months', $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.40.0110.00419.02
8.3.30.0120.00320.23
8.3.20.0040.00420.29
8.3.10.0000.00821.40
8.3.00.0090.00022.42
8.2.170.0060.01122.96
8.2.160.0060.01222.29
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0050.00321.15
8.2.110.0100.00022.23
8.2.100.0060.00620.01
8.2.90.0080.00019.53
8.2.80.0000.00817.97
8.2.70.0050.00318.00
8.2.60.0030.00618.05
8.2.50.0030.00518.07
8.2.40.0030.00518.59
8.2.30.0040.00419.45
8.2.20.0040.00418.07
8.2.10.0040.00418.09
8.2.00.0040.00418.20
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0000.00924.05
8.1.230.0080.00417.83
8.1.220.0040.00417.91
8.1.210.0040.00418.77
8.1.200.0000.01017.61
8.1.190.0080.00017.78
8.1.180.0040.00418.10
8.1.170.0000.00918.87
8.1.160.0050.00319.16
8.1.150.0050.00318.93
8.1.140.0050.00217.72
8.1.130.0030.00318.04
8.1.120.0070.00317.64
8.1.110.0040.00417.78
8.1.100.0040.00417.82
8.1.90.0040.00417.70
8.1.80.0080.00017.73
8.1.70.0030.00317.68
8.1.60.0090.00017.93
8.1.50.0080.00017.78
8.1.40.0060.00317.83
8.1.30.0050.00317.92
8.1.20.0040.00417.83
8.1.10.0080.00017.82
8.1.00.0080.00017.81
8.0.300.0030.00618.77
8.0.290.0000.00817.13
8.0.280.0000.00818.64
8.0.270.0040.00417.35
8.0.260.0060.00017.07
8.0.250.0040.00417.18
8.0.240.0040.00417.23
8.0.230.0070.00317.13
8.0.220.0000.00817.21
8.0.210.0000.00717.25
8.0.200.0030.00317.31
8.0.190.0000.00817.30
8.0.180.0000.00717.14
8.0.170.0000.00717.19
8.0.160.0070.00017.09
8.0.150.0000.00717.07
8.0.140.0000.00717.19
8.0.130.0000.00613.46
8.0.120.0040.00417.20
8.0.110.0040.00417.19
8.0.100.0050.00217.10
8.0.90.0040.00417.23
8.0.80.0100.01117.21
8.0.70.0030.00517.20
8.0.60.0000.00717.13
8.0.50.0000.00717.12
8.0.30.0090.01117.38
8.0.20.0120.00517.50
8.0.10.0040.00417.41
8.0.00.0100.01217.14
7.4.330.0050.00016.88
7.4.320.0000.00616.70
7.4.300.0000.00616.84
7.4.290.0030.00316.89
7.4.280.0070.00016.81
7.4.270.0040.00416.81
7.4.260.0060.00313.47
7.4.250.0050.00316.89
7.4.240.0040.00416.80
7.4.230.0030.00316.86
7.4.220.0090.01016.95
7.4.210.0070.00816.83
7.4.200.0030.00316.78
7.4.190.0000.00716.74
7.4.160.0130.00416.76
7.4.150.0130.00317.40
7.4.140.0130.00417.86
7.4.130.0110.00616.75
7.4.120.0100.00816.83
7.4.110.0080.00816.78
7.4.100.0090.00816.90
7.4.90.0150.00317.06
7.4.80.0070.01019.39
7.4.70.0060.01016.80
7.4.60.0090.00916.69
7.4.50.0080.00016.52
7.4.40.0070.01022.77
7.4.30.0120.00516.81
7.4.10.0070.00715.40
7.4.00.0080.00815.17
7.3.330.0030.00313.56
7.3.320.0030.00313.56
7.3.310.0070.00016.74
7.3.300.0070.00016.63
7.3.290.0040.01116.62
7.3.280.0080.00716.61
7.3.270.0070.01017.40
7.3.260.0060.01118.24
7.3.250.0080.00916.78
7.3.240.0070.01416.77
7.3.230.0060.01116.91
7.3.210.0070.01316.68
7.3.200.0090.00919.39
7.3.190.0130.01016.97
7.3.180.0100.00616.70
7.3.170.0100.00616.88
7.3.160.0070.01416.90
7.3.130.0070.01315.16
7.3.120.0060.01215.03
7.3.110.0080.00815.10
7.3.100.0090.00915.11
7.3.90.0020.01015.07
7.3.80.0080.00515.08
7.3.70.0080.00614.95
7.3.60.0030.00915.12
7.3.50.0020.01014.78
7.3.40.0070.00615.01
7.3.30.0100.00515.03
7.3.20.0080.00516.79
7.3.10.0020.01116.79
7.3.00.0060.00916.85
7.2.330.0040.01516.89
7.2.320.0120.01216.92
7.2.310.0100.00716.84
7.2.300.0000.01917.17
7.2.290.0100.00617.08
7.2.260.0060.00915.19
7.2.250.0110.00615.45
7.2.240.0030.01515.44
7.2.230.0120.00415.20
7.2.220.0040.01015.27
7.2.210.0030.01015.25
7.2.200.0060.00815.19
7.2.190.0050.00815.17
7.2.180.0050.01015.31
7.2.170.0060.00815.28
7.2.160.0060.01015.16
7.2.150.0000.01617.19
7.2.140.0070.01017.21
7.2.130.0000.01417.32
7.2.120.0000.01317.20
7.2.110.0090.00917.14
7.2.100.0070.01117.17
7.2.90.0060.00317.14
7.2.80.0070.00417.23
7.2.70.0060.00917.25
7.2.60.0010.01116.82
7.2.50.0070.00316.96
7.2.40.0100.00617.22
7.2.30.0030.01317.32
7.2.20.0030.00917.12
7.2.10.0070.00717.25
7.2.00.0060.00718.51
7.1.330.0050.01116.05
7.1.320.0010.01216.13
7.1.310.0070.00616.17
7.1.300.0040.00915.96
7.1.290.0080.00616.03
7.1.280.0060.00615.98
7.1.270.0030.00916.02
7.1.260.0050.00816.05
7.1.250.0130.00016.20
7.1.240.0040.00716.09
7.1.230.0080.00815.84
7.1.220.0110.00416.06
7.1.210.0090.00316.08
7.1.200.0060.00716.14
7.1.190.0100.00315.98
7.1.180.0110.00315.95
7.1.170.0070.00716.08
7.1.160.0100.00316.25
7.1.150.0060.00916.05
7.1.140.0040.01115.90
7.1.130.0000.00816.09
7.1.120.0000.00916.07
7.1.110.0090.00316.23
7.1.100.0070.00617.29
7.1.90.0030.01216.01
7.1.80.0000.01416.14
7.1.70.0080.00616.68
7.1.60.0040.01517.66
7.1.50.0060.00916.69
7.1.40.0000.01415.96
7.1.30.0000.01315.97
7.1.20.0070.00716.05
7.1.10.0030.00716.20
7.1.00.0050.02219.14
7.0.330.0090.00015.52
7.0.320.0100.00715.61
7.0.310.0040.00815.66
7.0.300.0070.01015.28
7.0.290.0060.00615.66
7.0.280.0040.00415.63
7.0.270.0030.01015.55
7.0.260.0060.00315.30
7.0.250.0030.00615.50
7.0.240.0070.00715.63
7.0.230.0070.00715.57
7.0.220.0080.00715.55
7.0.210.0030.00615.64
7.0.200.0070.00416.18
7.0.190.0000.00915.56
7.0.180.0130.00015.44
7.0.170.0070.00715.66
7.0.160.0100.00615.66
7.0.150.0000.00815.41
7.0.140.0070.03518.83
7.0.130.0060.00915.53
7.0.120.0070.00315.49
7.0.110.0030.00515.63
7.0.100.0050.02817.78
7.0.90.0050.04417.82
7.0.80.0080.04017.78
7.0.70.0220.04017.81
7.0.60.0130.03617.65
7.0.50.0080.04418.00
7.0.40.0020.03016.86
7.0.30.0070.04016.77
7.0.20.0070.03616.85
7.0.10.0030.03016.79
7.0.00.0080.02316.96
5.6.400.0100.00714.80
5.6.390.0050.00514.62
5.6.380.0100.00314.76
5.6.370.0000.00914.63
5.6.360.0030.00814.89
5.6.350.0000.01414.76
5.6.340.0030.00714.60
5.6.330.0070.00714.60
5.6.320.0000.00914.80
5.6.310.0070.00314.43
5.6.300.0060.00914.64
5.6.290.0100.00714.73
5.6.280.0070.03817.88
5.6.270.0030.01014.78
5.6.260.0110.00314.87
5.6.250.0070.04117.59
5.6.240.0080.04317.57
5.6.230.0070.04117.55
5.6.220.0090.04217.52
5.6.210.0140.02917.63
5.6.200.0020.05117.92
5.6.190.0060.02717.81
5.6.180.0030.04317.97
5.6.170.0080.02317.86
5.6.160.0080.04717.87
5.6.150.0020.02917.87
5.6.140.0030.02717.79
5.6.130.0040.02717.66
5.6.120.0050.02617.70
5.6.110.0020.02917.67
5.6.100.0070.02517.84
5.6.90.0130.01717.96
5.6.80.0030.01917.49
5.6.70.0030.02217.49
5.6.60.0050.01817.48
5.6.50.0050.02317.36
5.6.40.0070.02217.48
5.6.30.0080.01817.42
5.6.20.0100.01717.46
5.6.10.0050.02317.64
5.6.00.0020.02217.64
5.5.380.0050.04817.54
5.5.370.0060.04517.46
5.5.360.0070.04317.57
5.5.350.0050.02617.58
5.5.340.0080.02917.53
5.5.330.0090.04117.49
5.5.320.0060.03017.77
5.5.310.0060.03417.88
5.5.300.0070.02317.81
5.5.290.0050.02517.76
5.5.280.0020.02417.79
5.5.270.0070.02517.65
5.5.260.0060.02817.73
5.5.250.0050.02317.49
5.5.240.0030.02517.47
5.5.230.0050.02117.15
5.5.220.0050.02117.44
5.5.210.0100.03217.35
5.5.200.0060.04517.45
5.5.190.0000.02717.29
5.5.180.0050.02217.38
5.5.170.0040.00814.41
5.5.160.0030.02517.50
5.5.150.0060.02217.33
5.5.140.0030.02017.39
5.5.130.0030.02317.28
5.5.120.0080.02617.34
5.5.110.0050.02117.29
5.5.100.0030.02717.24
5.5.90.0030.02217.13
5.5.80.0050.02317.38
5.5.70.0060.01917.42
5.5.60.0070.02017.21
5.5.50.0080.02217.30
5.5.40.0050.02417.12
5.5.30.0020.02517.28
5.5.20.0030.02017.30
5.5.10.0080.02017.20
5.5.00.0050.02417.31
5.4.450.0050.02315.44
5.4.440.0050.03315.49
5.4.430.0040.02215.43
5.4.420.0020.02315.36
5.4.410.0070.01915.44
5.4.400.0030.02315.05
5.4.390.0070.01915.20
5.4.380.0000.02515.21
5.4.370.0040.02415.16
5.4.360.0080.01815.41
5.4.350.0080.01815.19
5.4.340.0020.03015.23
5.4.330.0080.00411.38
5.4.320.0050.01715.29
5.4.310.0070.02215.38
5.4.300.0060.02215.16
5.4.290.0000.02415.27
5.4.280.0060.02115.25
5.4.270.0080.02315.32
5.4.260.0110.01915.34
5.4.250.0080.01815.02
5.4.240.0000.02215.24
5.4.230.0040.01715.13
5.4.220.0020.02715.25
5.4.210.0050.02515.11
5.4.200.0050.01814.97
5.4.190.0030.02115.34
5.4.180.0020.01815.13
5.4.170.0060.01615.12
5.4.160.0080.03214.99
5.4.150.0050.02015.28
5.4.140.0020.02513.74
5.4.130.0060.03613.97
5.4.120.0100.03313.81
5.4.110.0030.02213.90
5.4.100.0100.02313.93
5.4.90.0080.04013.95
5.4.80.0020.04213.94
5.4.70.0050.03713.93
5.4.60.0080.03313.85
5.4.50.0080.03313.99
5.4.40.0070.03213.94
5.4.30.0090.03613.92
5.4.20.0050.03813.94
5.4.10.0030.04113.88
5.4.00.0030.03813.30
5.3.290.0050.02012.93
5.3.280.0020.02012.87
5.3.270.0000.02012.78
5.3.260.0030.02012.87
5.3.250.0050.02212.72
5.3.240.0020.02212.86
5.3.230.0050.03612.81
5.3.220.0020.02912.86
5.3.210.0070.04212.85
5.3.200.0070.03812.86
5.3.190.0100.03712.94
5.3.180.0020.02812.91
5.3.170.0050.02512.90
5.3.160.0050.04012.85
5.3.150.0080.03912.87
5.3.140.0060.03812.88
5.3.130.0060.04112.92
5.3.120.0020.03512.88
5.3.110.0090.03712.90
5.3.100.0030.04312.79
5.3.90.0030.03712.75
5.3.80.0070.03212.83
5.3.70.0100.03812.84
5.3.60.0030.02612.74
5.3.50.0100.03712.79
5.3.40.0050.04012.86
5.3.30.0060.03012.79
5.3.20.0070.03512.79
5.3.10.0000.02612.75
5.3.00.0050.03312.76
5.2.170.0130.06014.93
5.2.160.0030.05314.93
5.2.150.0070.05314.93
5.2.140.0070.06014.93
5.2.130.0070.06314.93
5.2.120.0030.06314.93
5.2.110.0130.03014.93
5.2.100.0100.05714.93
5.2.90.0030.06014.93
5.2.80.0100.05314.93
5.2.70.0070.06314.93
5.2.60.0070.05714.93
5.2.50.0000.03714.93
5.2.40.0100.05314.93
5.2.30.0030.04314.93
5.2.20.0030.03014.93
5.2.10.0030.03014.93
5.2.00.0000.03314.93
5.1.60.0030.02014.93
5.1.50.0000.05714.93
5.1.40.0030.04714.93
5.1.30.0000.02714.93
5.1.20.0070.06014.93
5.1.10.0130.03314.93
5.1.00.0000.06014.93
5.0.50.0030.04714.93
5.0.40.0000.04014.93
5.0.30.0030.02714.93
5.0.20.0030.03014.93
5.0.10.0000.04014.93
5.0.00.0070.06014.93
4.4.90.0000.04014.93
4.4.80.0000.03714.93
4.4.70.0070.03014.93
4.4.60.0000.03014.93
4.4.50.0070.02014.93
4.4.40.0000.05314.93
4.4.30.0030.01714.93
4.4.20.0000.03714.93
4.4.10.0030.02714.93
4.4.00.0030.02714.93
4.3.110.0030.03314.93
4.3.100.0000.01714.93
4.3.90.0000.02714.93
4.3.80.0030.05014.93
4.3.70.0030.03714.93
4.3.60.0030.03314.93
4.3.50.0000.01714.93
4.3.40.0000.02714.93
4.3.30.0000.03714.93
4.3.20.0000.02714.93
4.3.10.0030.03014.93
4.3.00.0000.02014.93

preferences:
44.45 ms | 400 KiB | 5 Q