3v4l.org

run code in 300+ PHP versions simultaneously
<?php $times = [ [ 'start' => '07:00', //started at 7 after midnight 'finish' => '15:00', //finished at 3 afternoon 'brake' => '01:30', //1 hour and 30 minutes of brake ], [ 'start' => '19:00', //started late afternoon 'finish' => '03:00', //finished at 3 after midnight 'brake' => '00:30', //30 minutes of brake ], ]; foreach($times as $time) { $start = $time['start']; $finish = $time['finish']; $break = $time['brake']; $startDate = \DateTime::createFromFormat('H:i', $start); $endDate = \DateTime::createFromFormat('H:i', $finish); if ($endDate < $startDate) { //end date is in the past, adjust ahead 24 hours $endDate->add(new \DateInterval('PT24H')); } $breakPeriod = new \DateInterval(vsprintf('PT%sH%sM', explode(':', $break))); $startDate->add($breakPeriod); $minutes = new \DateInterval('PT1M'); $datePeriods = new \DatePeriod($startDate, $minutes, $endDate); var_dump(iterator_count($datePeriods) / 60); }

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.5.00.0100.01220.18
8.4.150.0020.00014.05
8.4.140.0100.01117.66
8.4.130.0130.00718.80
8.4.120.0160.00517.95
8.4.110.0090.01319.80
8.4.100.0110.01117.83
8.4.90.0130.00820.38
8.4.80.0100.00318.83
8.4.70.0150.00618.20
8.4.60.0070.00419.03
8.4.50.0090.00819.74
8.4.40.0130.00919.49
8.4.30.0000.01619.46
8.4.20.0200.00319.82
8.4.10.0100.00318.04
8.3.280.0150.00618.81
8.3.270.0130.00716.66
8.3.260.0080.01216.80
8.3.250.0080.01316.44
8.3.240.0050.00416.87
8.3.230.0130.00416.69
8.3.220.0140.00718.96
8.3.210.0100.00918.86
8.3.200.0050.00416.35
8.3.190.0090.01117.38
8.3.180.0120.00816.82
8.3.170.0130.00617.25
8.3.160.0060.01318.38
8.3.150.0100.01020.72
8.3.140.0040.00416.85
8.3.130.0000.00918.19
8.3.120.0040.00818.79
8.3.110.0040.00416.75
8.3.100.0100.00024.06
8.3.90.0080.00016.53
8.3.80.0120.00018.68
8.3.70.0090.00916.62
8.3.60.0090.01216.75
8.3.50.0120.01016.51
8.3.40.0000.01518.93
8.3.30.0100.00718.84
8.3.20.0090.00021.77
8.3.10.0030.00521.87
8.3.00.0060.00319.68
8.2.290.0130.00716.79
8.2.280.0070.00418.30
8.2.270.0110.00719.00
8.2.260.0070.01420.79
8.2.250.0040.00416.90
8.2.240.0110.00017.41
8.2.230.0000.01020.94
8.2.220.0030.00737.54
8.2.210.0100.00726.77
8.2.200.0030.00618.66
8.2.190.0160.00616.88
8.2.180.0140.00416.58
8.2.170.0100.00622.96
8.2.160.0000.01520.41
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00319.92
8.2.110.0100.00020.51
8.2.100.0030.01317.97
8.2.90.0030.00619.39
8.2.80.0100.00724.71
8.2.70.0030.00617.75
8.2.60.0060.00318.18
8.2.50.0060.00318.07
8.2.40.0030.00620.19
8.2.30.0000.00818.12
8.2.20.0050.00318.11
8.2.10.0060.00318.18
8.2.00.0000.00818.20
8.1.330.0100.01016.05
8.1.320.0090.01116.04
8.1.310.0090.00018.44
8.1.300.0110.00020.19
8.1.290.0030.00618.88
8.1.280.0100.00725.92
8.1.270.0090.00023.77
8.1.260.0110.00026.35
8.1.250.0060.00328.09
8.1.240.0030.00723.61
8.1.230.0110.00020.91
8.1.220.0080.00017.93
8.1.210.0060.00318.77
8.1.200.0050.00517.23
8.1.190.0090.00017.35
8.1.180.0030.00618.10
8.1.170.0030.00618.45
8.1.160.0080.00019.01
8.1.150.0000.00818.70
8.1.140.0030.00517.79
8.1.130.0050.00219.05
8.1.120.0040.00417.51
8.1.110.0050.00317.59
8.1.100.0040.00417.48
8.1.90.0090.00017.59
8.1.80.0040.00417.48
8.1.70.0030.00517.61
8.1.60.0070.00317.66
8.1.50.0060.00317.59
8.1.40.0030.00617.57
8.1.30.0080.00417.78
8.1.20.0030.00617.67
8.1.10.0040.00417.60
8.1.00.0040.00417.67
8.0.300.0040.00418.77
8.0.290.0040.00417.00
8.0.280.0050.00318.57
8.0.270.0040.00416.95
8.0.260.0000.00717.09
8.0.250.0040.00417.14
8.0.240.0040.00417.16
8.0.230.0040.00417.14
8.0.220.0000.00717.08
8.0.210.0000.00717.08
8.0.200.0050.00217.20
8.0.190.0000.00817.20
8.0.180.0040.00417.01
8.0.170.0040.00417.01
8.0.160.0040.00417.03
8.0.150.0000.00917.16
8.0.140.0040.00417.08
8.0.130.0000.00813.35
8.0.120.0040.00416.98
8.0.110.0080.00016.99
8.0.100.0000.00817.11
8.0.90.0040.00417.04
8.0.80.0100.00717.14
8.0.70.0090.00017.09
8.0.60.0060.00317.13
8.0.50.0060.00317.12
8.0.30.0130.00617.27
8.0.20.0150.01017.31
8.0.10.0120.00917.10
8.0.00.0080.01217.11
7.4.330.0030.00315.55
7.4.320.0000.00716.59
7.4.300.0020.00616.62
7.4.290.0040.00416.63
7.4.280.0080.00016.71
7.4.270.0000.00716.67
7.4.260.0050.00216.67
7.4.250.0000.00816.65
7.4.240.0000.00816.46
7.4.230.0070.00016.59
7.4.220.0050.00316.56
7.4.210.0050.01216.64
7.4.200.0030.00516.71
7.4.160.0080.01116.62
7.4.150.0110.02417.01
7.4.140.0100.01117.64
7.4.130.0110.01016.59
7.4.120.0080.01416.73
7.4.110.0100.00816.59
7.4.100.0100.00916.52
7.4.90.0120.00916.59
7.4.80.0130.00917.16
7.4.70.0080.01316.63
7.4.60.0100.01216.66
7.4.50.0110.01016.47
7.4.40.0130.00716.65
7.4.30.0090.01316.53
7.4.20.0110.01016.53
7.4.10.0090.01316.62
7.4.00.0110.00816.13
7.3.330.0000.00513.24
7.3.320.0070.00013.34
7.3.310.0070.00016.24
7.3.300.0050.00216.40
7.3.290.0070.00016.39
7.3.280.0130.00616.33
7.3.270.0130.00616.96
7.3.260.0110.01016.60
7.3.250.0070.01116.61
7.3.240.0090.00916.65
7.3.230.0110.00916.57
7.3.220.0100.00916.49
7.3.210.0120.00916.62
7.3.200.0090.01116.48
7.3.190.0120.01416.52
7.3.180.0120.00816.55
7.3.170.0110.01116.51
7.3.160.0120.00816.57
7.3.150.0090.01216.51
7.3.140.0110.01016.50
7.3.130.0110.01016.52
7.3.120.0080.01016.14
7.3.110.0100.00916.17
7.3.100.0120.00616.27
7.3.90.0080.01216.23
7.3.80.0110.00816.23
7.3.70.0100.01016.19
7.3.60.0120.00616.12
7.3.50.0100.01016.12
7.3.40.0080.01016.16
7.3.30.0110.00916.15
7.3.20.0140.00616.57
7.3.10.0110.00916.53
7.3.00.0100.00916.60
7.2.340.0070.01216.67
7.2.330.0140.00816.81
7.2.320.0110.01016.69
7.2.310.0080.01316.78
7.2.300.0140.01016.64
7.2.290.0120.01016.59
7.2.280.0140.00716.72
7.2.270.0110.01116.77
7.2.260.0120.01016.80
7.2.250.0110.00916.52
7.2.240.0090.01416.36
7.2.230.0110.00916.44
7.2.220.0110.01116.31
7.2.210.0070.01316.40
7.2.200.0090.00916.32
7.2.190.0110.01116.41
7.2.180.0080.01216.37
7.2.170.0110.00916.35
7.2.160.0070.01316.67
7.2.150.0100.01216.72
7.2.140.0100.01316.72
7.2.130.0280.01116.74
7.2.120.0110.01216.70
7.2.110.0120.01116.71
7.2.100.0150.01316.52
7.2.90.0110.01216.61
7.2.80.0110.01416.80
7.2.70.0120.01216.68
7.2.60.0090.01416.71
7.2.50.0150.01016.74
7.2.40.0200.01116.68
7.2.30.0190.00816.85
7.2.20.0120.01517.45
7.2.10.0150.01217.54
7.2.00.0150.01417.55
7.1.330.0210.00815.85
7.1.320.0170.01115.82
7.1.310.0200.00815.79
7.1.300.0210.01015.81
7.1.290.0250.01015.73
7.1.280.0170.01215.76
7.1.270.0160.01315.81
7.1.260.0200.00815.70
7.1.250.0230.00915.66
7.1.240.0240.00715.69
7.1.230.0240.01015.66
7.1.220.0250.00815.63
7.1.210.0220.01115.77
7.1.200.0310.01115.71
7.1.190.0270.00915.60
7.1.180.0290.00915.62
7.1.170.0240.01015.77
7.1.160.0230.01215.70
7.1.150.0230.01215.75
7.1.140.0230.01216.48
7.1.130.0250.00916.44
7.1.120.0210.01216.42
7.1.110.0190.01416.35
7.1.100.0200.01116.25
7.1.90.0190.01316.20
7.1.80.0220.01116.27
7.1.70.0210.01315.91
7.1.60.0270.01321.87
7.1.50.0280.01321.88
7.1.40.0260.01421.78
7.1.30.0240.01321.67
7.1.20.0270.01621.85
7.1.10.0190.01415.72
7.1.00.0200.01215.80
7.0.330.0230.01015.34
7.0.320.0220.01215.30
7.0.310.0210.01315.37
7.0.300.0240.00915.36
7.0.290.0230.01315.34
7.0.280.0190.01215.41
7.0.270.0210.01016.08
7.0.260.0250.01116.08
7.0.250.0200.01015.92
7.0.240.0190.01215.92
7.0.230.0180.01315.89
7.0.220.0230.00615.92
7.0.210.0170.01315.51
7.0.200.0190.01215.67
7.0.190.0190.01415.57
7.0.180.0200.01515.39
7.0.170.0170.01015.43
7.0.160.0310.01115.42
7.0.150.0270.01215.39
7.0.140.0140.01415.40
7.0.130.0280.01215.41
7.0.120.0260.01215.52
7.0.110.0180.01115.45
7.0.100.0170.01315.37
7.0.90.0190.01315.37
7.0.80.0190.00915.44
7.0.70.0240.01415.36
7.0.60.0190.01115.42
7.0.50.0170.01015.38
7.0.40.0200.00915.48
7.0.30.0190.00915.40
7.0.20.0130.01515.40
7.0.10.0190.00915.40
7.0.00.0210.00815.47
5.6.400.0220.01116.09
5.6.390.0260.00916.15
5.6.380.0210.01316.13
5.6.370.0220.01216.09
5.6.360.0240.01516.08
5.6.350.0240.01516.09
5.6.340.0240.01216.03
5.6.330.0260.01216.05
5.6.320.0240.01216.02
5.6.310.0210.01216.24
5.6.300.0200.03517.71
5.6.290.0220.03217.65
5.6.280.0270.04017.68
5.6.270.0220.03517.71
5.6.260.0230.03517.71
5.6.250.0230.03117.74
5.6.240.0210.03517.73
5.6.230.0220.03617.76
5.6.220.0210.03717.67
5.6.210.0210.03617.70
5.6.200.0210.03617.73
5.6.190.0220.03617.63
5.6.180.0230.03117.70
5.6.170.0220.02917.79
5.6.160.0230.02917.66
5.6.150.0210.03417.69
5.6.140.0230.03417.73
5.6.130.0170.03517.79
5.6.120.0220.03417.70
5.6.110.0230.02817.71
5.6.100.0220.03417.66
5.6.90.0230.03117.59
5.6.80.0210.03417.45
5.6.70.0210.03217.36
5.6.60.0210.03017.40
5.6.50.0200.03317.40
5.6.40.0180.03117.36
5.6.30.0230.03117.40
5.6.20.0210.02817.42
5.6.10.0190.03417.41
5.6.00.0200.03217.30

preferences:
30.82 ms | 403 KiB | 5 Q