3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(-1); ini_set('display_errors', 'On'); /** * @param DateTimeImmutable $start * @param DateTimeImmutable $end * * @return Generator */ function remainingDaysPerMonthBetween(\DateTimeImmutable $start, \DateTimeImmutable $end): \Generator { while ($start < $end) { $diff = $start->diff(min( $start->modify('last day of this month'), $end )); yield [$start, $diff->days]; $start = $start->modify('first day of next month'); } } $start = new \DateTimeImmutable('2019-02-11'); $end = new \DateTimeImmutable('2019-04-23'); foreach (remainingDaysPerMonthBetween($start, $end) as [$date, $remainingDays]) { printf("%s: %d\n", $date->format('M'), $remainingDays + 1); }

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.70.0040.01217.00
8.3.60.0120.00316.47
8.3.50.0110.01116.32
8.3.40.0120.00619.00
8.3.30.0070.00718.80
8.3.20.0000.00721.89
8.3.10.0030.00620.74
8.3.00.0060.00319.39
8.2.190.0090.00916.88
8.2.180.0110.00418.17
8.2.170.0150.00022.96
8.2.160.0040.01120.19
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0120.00319.48
8.2.110.0100.00021.09
8.2.100.0080.00417.97
8.2.90.0040.00418.13
8.2.80.0080.00318.18
8.2.70.0000.00818.16
8.2.60.0000.00818.28
8.2.50.0030.00618.10
8.2.40.0060.00319.44
8.2.30.0030.00619.57
8.2.20.0070.00018.32
8.2.10.0070.00019.72
8.2.00.0080.00018.09
8.1.280.0150.00625.92
8.1.270.0080.00020.33
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0090.00023.91
8.1.230.0090.00322.66
8.1.220.0040.00417.79
8.1.210.0050.00318.78
8.1.200.0030.00617.50
8.1.190.0060.00317.38
8.1.180.0000.00818.10
8.1.170.0090.00018.67
8.1.160.0000.00718.90
8.1.150.0050.00219.05
8.1.140.0080.00017.77
8.1.130.0050.00320.14
8.1.120.0040.00417.75
8.1.110.0040.00417.73
8.1.100.0040.00417.71
8.1.90.0000.00817.73
8.1.80.0000.01117.67
8.1.70.0070.00017.75
8.1.60.0030.00517.83
8.1.50.0030.00617.63
8.1.40.0000.00817.73
8.1.30.0000.00917.88
8.1.20.0060.00317.88
8.1.10.0030.00617.84
8.1.00.0020.00517.88
8.0.300.0080.00019.86
8.0.290.0000.00817.25
8.0.280.0040.00418.68
8.0.270.0000.00717.21
8.0.260.0040.00418.67
8.0.250.0040.00317.31
8.0.240.0040.00417.37
8.0.230.0040.00417.31
8.0.220.0000.00817.29
8.0.210.0000.00717.14
8.0.200.0040.00417.18
8.0.190.0040.00417.34
8.0.180.0040.00417.22
8.0.170.0040.00417.23
8.0.160.0030.00617.28
8.0.150.0000.00717.13
8.0.140.0070.00717.20
8.0.130.0050.00013.54
8.0.120.0030.00617.23
8.0.110.0050.00217.21
8.0.100.0070.00017.21
8.0.90.0070.00017.04
8.0.80.0060.00917.22
8.0.70.0040.00417.07
8.0.60.0030.00517.19
8.0.50.0050.00217.32
8.0.30.0090.01117.41
8.0.20.0090.00917.59
8.0.10.0000.00717.49
8.0.00.0160.00517.04
7.4.330.0000.00615.55
7.4.320.0070.00016.70
7.4.300.0070.00016.85
7.4.290.0070.00016.73
7.4.280.0050.00316.64
7.4.270.0030.00316.89
7.4.260.0030.00516.85
7.4.250.0030.00516.78
7.4.240.0040.00416.62
7.4.230.0000.00816.61
7.4.220.0060.00316.78
7.4.210.0090.00616.77
7.4.200.0050.00316.94
7.4.160.0110.00716.79
7.4.140.0090.01517.86
7.4.130.0120.00616.61
7.4.120.0100.01016.88
7.4.110.0220.00016.95
7.4.100.0130.01016.75
7.4.90.0120.00616.75
7.4.80.0100.00719.39
7.4.70.0090.00916.66
7.4.60.0060.01016.70
7.4.50.0000.01116.95
7.4.40.0070.01616.78
7.4.00.0000.01515.12
7.3.330.0000.00513.37
7.3.320.0050.00013.45
7.3.310.0000.00716.45
7.3.300.0000.00716.48
7.3.290.0080.00016.43
7.3.280.0060.01216.60
7.3.260.0110.00816.77
7.3.240.0100.01016.70
7.3.230.0030.01316.93
7.3.210.0100.00716.90
7.3.200.0090.00616.64
7.3.190.0160.00616.81
7.3.180.0080.00816.85
7.3.170.0120.00416.71
7.3.160.0100.01016.75
7.3.20.1210.00315.00
7.3.10.1010.01314.94
7.3.00.1310.00015.27
7.2.330.0070.01017.16
7.2.320.0040.01616.85
7.2.310.0090.00816.70
7.2.300.0080.00817.12
7.2.290.0090.01316.73
7.2.150.1110.01015.50
7.2.140.1110.00715.56
7.2.130.0940.00315.36
7.2.120.1920.00315.25
7.2.110.2560.01015.23
7.2.100.2320.00715.10
7.2.90.2220.01015.37
7.2.80.1950.01615.29
7.2.70.1190.01315.45
7.2.60.1080.01015.26
7.2.50.1790.01115.50
7.2.40.1350.00015.33
7.2.30.1180.01015.46
7.2.20.2360.00715.13
7.2.10.1290.01015.48
7.2.00.1240.01015.33
7.1.250.1090.01014.04

preferences:
29.71 ms | 401 KiB | 5 Q