3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * step 1: create benchmark array * containing all consecutive dates from $start */ $start = '2019-10-27 16:30:00'; $days = 14; // total number of days (including $start) $dateObj = new DateTimeImmutable($start); $benchmarkDates[] = $dateObj->format('Y-m-d H:i:s'); // store the first bench date for ($i = 1; $i < $days; $i++) { $period = 'P' . $i . 'D'; $interval = new DateInterval($period); $dateObj0 = $dateObj->add($interval); $benchmarkDates[] = $dateObj0->format('Y-m-d H:i:s'); // store the next bench date } /* * create dummy array mimicking the OP's presented structure * create date gaps */ $start = '2019-10-27 16:30:00'; $days = 14; // total number of days (including $start) $dateObj = new DateTimeImmutable($start); $subject[0][] = ['datum' => $dateObj]; // store the first object for ($i = 2; $i < $days; $i += 2) { $period = 'P' . $i . 'D'; $interval = new DateInterval($period); $dateObj0 = $dateObj->add($interval); $subject[$i / 2][] = ['datum' => $dateObj0]; // store subsequent objects } /* step 2: get dates from subject array ($subject). */ foreach ($subject as $key => $value) { foreach ($value as $key => $value) { $subjectDates[] = $value['datum']->format('Y-m-d H:i:s'); // store dates } } /* * step 3: find / store missing dates * check subject against benchmark */ foreach($benchmarkDates as $key => $value) { if(!in_array($value, $subjectDates)) { $missingDates[] = $value; } } echo 'benchmark array:' . "\r\n"; print_r($benchmarkDates); echo 'subject array:' . "\r\n";; print_r($subjectDates); echo 'missing dates:' . "\r\n";; print_r($missingDates);

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.4.130.0120.00918.76
8.4.120.0130.00818.86
8.4.110.0060.00518.99
8.4.100.0100.00817.97
8.4.90.0110.01017.93
8.4.80.0030.00522.52
8.4.70.0100.01017.96
8.4.60.0120.00919.05
8.4.50.0080.01218.18
8.4.40.0130.00619.76
8.4.30.0040.00422.54
8.4.20.0100.01018.69
8.4.10.0000.01017.77
8.3.260.0120.00816.73
8.3.250.0110.01016.97
8.3.240.0050.00416.69
8.3.230.0100.00916.73
8.3.220.0120.00517.39
8.3.210.0080.00716.86
8.3.200.0100.01016.61
8.3.190.0100.00916.75
8.3.180.0100.00916.81
8.3.170.0000.01816.78
8.3.160.0090.00020.44
8.3.150.0040.00416.54
8.3.140.0030.00616.81
8.3.130.0130.00016.91
8.3.120.0060.00319.04
8.3.110.0080.00016.88
8.3.100.0070.01016.78
8.3.90.0050.00316.86
8.3.80.0090.00317.97
8.3.70.0150.00316.75
8.3.60.0120.00616.85
8.3.50.0100.00718.24
8.3.40.0060.01019.11
8.3.30.0130.00618.95
8.3.20.0050.00321.05
8.3.10.0080.00021.90
8.3.00.0050.00322.36
8.2.290.0100.00820.34
8.2.280.0060.00518.71
8.2.270.0000.01517.50
8.2.260.0070.01116.95
8.2.250.0080.00018.81
8.2.240.0160.00018.99
8.2.230.0050.00320.94
8.2.220.0060.00324.06
8.2.210.0110.00726.77
8.2.200.0060.00616.75
8.2.190.0030.01316.63
8.2.180.0130.00316.75
8.2.170.0070.00722.96
8.2.160.0090.00620.52
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0000.00726.16
8.2.110.0060.00322.07
8.2.100.0090.00321.11
8.2.90.0000.00819.36
8.2.80.0060.00317.97
8.2.70.0060.00318.05
8.2.60.0000.00818.21
8.2.50.0000.00818.10
8.2.40.0000.01119.20
8.2.30.0000.00919.49
8.2.20.0060.00318.43
8.2.10.0030.00619.40
8.2.00.0040.00419.54
8.1.330.0090.00922.06
8.1.320.0110.00916.31
8.1.310.0070.01118.29
8.1.300.0030.00617.97
8.1.290.0090.00018.88
8.1.280.0090.00925.92
8.1.270.0080.00022.39
8.1.260.0050.00326.35
8.1.250.0060.00328.09
8.1.240.0060.00323.96
8.1.230.0060.00619.10
8.1.220.0080.00017.77
8.1.210.0080.00018.77
8.1.200.0060.00317.60
8.1.190.0060.00317.35
8.1.180.0070.00318.10
8.1.170.0060.00320.60
8.1.160.0050.00218.99
8.1.150.0050.00218.90
8.1.140.0040.00420.76
8.1.130.0040.00421.91
8.1.120.0030.00517.54
8.1.110.0000.00717.62
8.1.100.0060.00317.70
8.1.90.0000.00717.61
8.1.80.0000.00817.71
8.1.70.0000.00717.72
8.1.60.0040.00417.76
8.1.50.0080.00017.73
8.1.40.0030.00617.57
8.1.30.0030.00617.67
8.1.20.0040.00417.72
8.1.10.0050.00317.73
8.1.00.0030.00517.70
8.0.300.0040.00418.77
8.0.290.0030.00617.00
8.0.280.0000.00718.56
8.0.270.0050.00317.38
8.0.260.0000.00620.05
8.0.250.0080.00017.10
8.0.240.0030.00517.23
8.0.230.0000.00817.20
8.0.220.0030.00317.04
8.0.210.0000.00817.15
8.0.200.0030.00317.13
8.0.190.0000.00717.19
8.0.180.0070.00017.08
8.0.170.0070.00317.16
8.0.160.0040.00417.14
8.0.150.0050.00217.08
8.0.140.0000.00917.10
8.0.130.0060.00013.45
8.0.120.0000.00717.07
8.0.110.0070.00016.96
8.0.100.0000.00716.93
8.0.90.0040.00417.09
8.0.80.0070.01417.10
8.0.70.0000.00817.09
8.0.60.0040.00417.05
8.0.50.0000.00817.03
8.0.30.0060.01317.29
8.0.20.0130.00717.40
8.0.10.0080.00017.28
8.0.00.0150.00317.11
7.4.330.0020.00215.55
7.4.320.0030.00316.77
7.4.300.0000.00716.62
7.4.290.0030.00616.70
7.4.280.0000.00816.70
7.4.270.0070.00016.73
7.4.260.0000.00613.31
7.4.250.0030.00616.77
7.4.240.0020.00516.63
7.4.230.0030.00516.79
7.4.220.0050.00316.61
7.4.210.0090.00816.82
7.4.200.0050.00316.63
7.4.130.0120.00616.64
7.4.120.0060.01916.81
7.4.110.0120.00816.72
7.4.100.0140.00516.73
7.4.90.0140.00416.84
7.4.80.0170.00719.39
7.4.70.0030.01416.71
7.4.60.0150.00716.75
7.4.50.0120.00616.65
7.4.40.0100.00716.88
7.4.00.0060.01015.39
7.3.330.0000.00716.31
7.3.320.0050.00013.46
7.3.310.0000.00816.42
7.3.300.0040.00416.53
7.3.290.0070.00816.53
7.3.280.0160.00316.50
7.3.260.0110.00816.66
7.3.230.0180.00016.92
7.3.210.0190.00016.89
7.3.200.0060.01516.77
7.3.190.0170.00016.64
7.3.180.0060.01316.72
7.3.170.0120.00616.79
7.3.160.0120.00416.60
7.3.120.0130.00614.77
7.3.110.0090.00915.28
7.3.100.0060.00915.08
7.3.90.0070.00615.05
7.3.80.0090.00715.07
7.3.70.0050.01114.92
7.3.60.0050.00914.93
7.3.50.0110.00315.01
7.3.40.0080.00815.02
7.3.30.0050.01014.87
7.3.20.0070.00716.09
7.3.10.0060.01015.89
7.3.00.0020.01015.95
7.2.330.0140.00316.92
7.2.320.0090.00917.00
7.2.310.0090.00916.80
7.2.300.0180.00416.61
7.2.290.0090.00917.02
7.2.240.0080.01115.18
7.2.230.0060.00915.24
7.2.220.0130.00515.39
7.2.210.0050.01215.24
7.2.200.0100.00615.28
7.2.190.0070.00615.30
7.2.180.0050.00815.33
7.2.170.0090.00615.15
7.2.160.0130.00315.18
7.2.150.0100.00816.29
7.2.140.0090.00916.20
7.2.130.0080.00616.11
7.2.120.0090.00616.27
7.2.110.0080.00816.18
7.2.100.0090.00316.18
7.2.90.0030.01116.22
7.2.80.0100.00416.18
7.2.70.0100.00516.00
7.2.60.0060.01016.18
7.2.50.0030.01216.19
7.2.40.0030.01216.33
7.2.30.0070.00916.19
7.2.20.0060.01016.14
7.2.10.0080.01016.11
7.2.00.0050.00816.09
7.1.330.0030.00916.05
7.1.320.0060.01015.17
7.1.310.0020.01315.03
7.1.300.0030.01115.09
7.1.290.0110.00514.97
7.1.280.0070.00914.92
7.1.270.0060.00815.12
7.1.260.0090.00515.17
7.1.250.0070.01015.00

preferences:
130 ms | 403 KiB | 5 Q