3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $excludedRanges = [ ['2017-07-20', '2017-07-21', 'Python', true], ['2017-08-14', '2017-08-15', 'Python', true], ['2017-09-04', '2017-09-08', 'Joris en de Draak', true], ['2017-09-04', '2017-11-28', 'De Tuinman en de Fakir', false], ['2017-09-04', '2017-09-04', 'Spookslot', false], ['2017-09-11', '2017-09-22', 'Fata Morgana', true], ['2017-09-11', '2017-12-01', 'Python', true], ['2017-09-11', '2017-09-15', 'De Oude Tufferbaan', false], ['2017-09-25', '2017-09-29', 'Carnaval Festival', false], ['2017-10-02', '2017-10-06', 'Villa Volta', false], ['2017-10-02', '2017-10-13', 'Gondoletta', false], ['2017-10-07', '2017-10-13', 'Aquanura', false], ]; $startDate = '2017-09-01'; $endDate = '2017-11-30'; $startDay = date('z', strtotime($startDate)); $endDay = date('z', strtotime($endDate)); for($i = $startDay, $j = 0; $i <= $endDay; $i++, $j++) { $date = date("Y-m-d", strtotime($startDate . " +" . $j . ' days')); $dayOfWeek = date("w", strtotime($date)); # Only wednesdays and saturdays if ($dayOfWeek !== 3 && $dayOfWeek !== 5) { continue; } if (($closed = isAnAttractionClosed($i, $excludedRanges)) !== false) { echo $date . ': ' . $closed[2] . ' gesloten. ' . ($closed[3] ? 'Nee' : 'Liever niet') . PHP_EOL; continue; } echo $date . ': Ja' . PHP_EOL; } /** * @param int $dayOfTheYear * @param array $closedAttractions * @return bool */ function isAnAttractionClosed($dayOfTheYear, $closedAttractions) { foreach ($closedAttractions as $closed) { $start = date('z', strtotime($closed[0])); $end = date('z', strtotime($closed[1])); if ($dayOfTheYear >= $start && $dayOfTheYear <= $end) { return $closed; } } return false; }

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.0190.00316.88
8.3.50.0060.00916.54
8.3.40.0120.00319.14
8.3.30.0040.01118.67
8.3.20.0080.00020.33
8.3.10.0060.00323.51
8.3.00.0030.00620.13
8.2.180.0030.01316.63
8.2.170.0120.00922.96
8.2.160.0070.00720.55
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0030.00621.13
8.2.120.0090.00026.35
8.2.110.0100.00019.26
8.2.100.0080.00418.22
8.2.90.0030.00519.34
8.2.80.0000.00818.05
8.2.70.0040.00417.75
8.2.60.0040.00417.93
8.2.50.0000.00918.16
8.2.40.0040.00420.57
8.2.30.0000.00821.20
8.2.20.0000.00818.32
8.2.10.0030.00618.16
8.2.00.0050.00318.26
8.1.280.0070.01025.92
8.1.270.0050.00322.22
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0040.00424.05
8.1.230.0090.00617.64
8.1.220.0070.00317.77
8.1.210.0030.00518.77
8.1.200.0060.00317.60
8.1.190.0060.00317.61
8.1.180.0080.00018.10
8.1.170.0000.00820.60
8.1.160.0000.00819.09
8.1.150.0030.00520.81
8.1.140.0000.01019.73
8.1.130.0000.00819.03
8.1.120.0030.00517.76
8.1.110.0030.00517.67
8.1.100.0060.00317.76
8.1.90.0050.00317.73
8.1.80.0000.00917.75
8.1.70.0060.00317.73
8.1.60.0030.00817.84
8.1.50.0130.00017.76
8.1.40.0080.00017.72
8.1.30.0030.00617.70
8.1.20.0050.00317.71
8.1.10.0090.00017.60
8.1.00.0000.00817.59
8.0.300.0040.00418.77
8.0.290.0050.00317.00
8.0.280.0040.00418.59
8.0.270.0040.00417.32
8.0.260.0000.00717.04
8.0.250.0040.00417.30
8.0.240.0040.00417.25
8.0.230.0000.00717.23
8.0.220.0040.00417.11
8.0.210.0000.00817.08
8.0.200.0030.00317.25
8.0.190.0060.00317.10
8.0.180.0000.00917.21
8.0.170.0000.00717.22
8.0.160.0040.00417.25
8.0.150.0000.00817.21
8.0.140.0040.00417.00
8.0.130.0030.00313.61
8.0.120.0000.00816.99
8.0.110.0050.00317.07
8.0.100.0090.00017.17
8.0.90.0030.00617.11
8.0.80.0070.01017.16
8.0.70.0040.00416.97
8.0.60.0000.00816.97
8.0.50.0040.00417.05
8.0.30.0090.01017.35
8.0.20.0120.00717.40
8.0.10.0060.00317.17
8.0.00.0100.01017.17
7.4.330.0030.00315.55
7.4.320.0030.00316.77
7.4.300.0030.00316.82
7.4.290.0000.00716.85
7.4.280.0000.00916.76
7.4.270.0030.00516.80
7.4.260.0040.00416.60
7.4.250.0070.00016.77
7.4.240.0000.00716.75
7.4.230.0000.00716.87
7.4.220.0100.01716.70
7.4.210.0070.01816.64
7.4.200.0040.00416.83
7.4.160.0050.01116.78
7.4.150.0130.00417.40
7.4.140.0130.00917.86
7.4.130.0070.01416.59
7.4.120.0070.01316.86
7.4.110.0180.00016.77
7.4.100.0130.01016.64
7.4.90.0150.00316.71
7.4.80.0100.00719.39
7.4.70.0130.00516.77
7.4.60.0120.00616.91
7.4.50.0100.00316.42
7.4.40.0100.00716.77
7.4.30.0060.01116.68
7.4.00.0000.01615.34
7.3.330.0000.00513.55
7.3.320.0030.00313.43
7.3.310.0050.00316.45
7.3.300.0050.00216.53
7.3.290.0090.00716.53
7.3.280.0060.01116.56
7.3.270.0090.00917.40
7.3.260.0100.00816.64
7.3.250.0050.01216.65
7.3.240.0080.01016.72
7.3.230.0140.01016.72
7.3.210.0100.00716.69
7.3.200.0130.00916.57
7.3.190.0130.00316.78
7.3.180.0160.00716.63
7.3.170.0090.00916.80
7.3.160.0160.00316.68
7.2.330.0140.01216.89
7.2.320.0030.01517.13
7.2.310.0030.01516.93
7.2.300.0100.01316.84
7.2.290.0110.00716.93
7.2.60.0060.01017.03
7.2.00.0030.00919.43
7.1.200.0060.00616.19
7.1.100.0030.00718.46
7.1.70.0000.01417.29
7.1.60.0260.00735.01
7.1.50.0210.01034.98
7.1.40.0160.01634.72
7.1.30.0190.02234.66
7.1.20.0380.01034.91
7.1.10.0000.01617.02
7.1.00.0040.01116.99
7.0.200.0090.00616.89
7.0.190.0030.01016.75
7.0.180.0070.01116.46
7.0.170.0060.01516.56
7.0.160.0030.01716.70
7.0.150.0040.01116.46
7.0.140.0090.00616.45
7.0.130.0000.01516.61
7.0.120.0040.01116.55
7.0.110.0100.00616.61
7.0.100.0120.00316.36
7.0.90.0040.01116.49
7.0.80.0070.00716.44
7.0.70.0040.01116.40
7.0.60.0060.00916.16
7.0.50.0120.00616.25
7.0.40.0060.01016.51
7.0.30.0100.00516.52
7.0.20.0070.01016.68
7.0.10.0090.01216.47
7.0.00.0030.01016.28

preferences:
45.53 ms | 401 KiB | 5 Q