3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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.0090.00616.88
8.3.50.0040.01116.29
8.3.40.0130.00318.93
8.3.30.0110.00419.02
8.3.20.0060.00322.09
8.3.10.0080.00021.74
8.3.00.0000.00820.13
8.2.180.0130.00616.73
8.2.170.0060.00922.96
8.2.160.0040.01120.56
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0070.00721.10
8.2.120.0040.00426.35
8.2.110.0090.00019.39
8.2.100.0090.00318.28
8.2.90.0050.00519.30
8.2.80.0030.00518.16
8.2.70.0090.00017.75
8.2.60.0000.00818.05
8.2.50.0030.00618.10
8.2.40.0040.00420.59
8.2.30.0030.00521.22
8.2.20.0050.00318.25
8.2.10.0050.00318.18
8.2.00.0050.00318.32
8.1.280.0140.00425.92
8.1.270.0000.00824.10
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00323.93
8.1.230.0120.00317.89
8.1.220.0000.00817.78
8.1.210.0080.00018.77
8.1.200.0060.00317.48
8.1.190.0030.00517.47
8.1.180.0000.00818.10
8.1.170.0000.00820.60
8.1.160.0000.00819.07
8.1.150.0040.00420.69
8.1.140.0030.00719.68
8.1.130.0050.00219.03
8.1.120.0000.00817.72
8.1.110.0000.00717.68
8.1.100.0040.00417.75
8.1.90.0040.00417.76
8.1.80.0070.00017.74
8.1.70.0000.00717.71
8.1.60.0100.00317.63
8.1.50.0060.00617.73
8.1.40.0060.00317.61
8.1.30.0030.00517.81
8.1.20.0090.00017.82
8.1.10.0060.00317.74
8.1.00.0030.00517.58
8.0.300.0000.00818.77
8.0.290.0080.00017.00
8.0.280.0070.00018.55
8.0.270.0000.00717.24
8.0.260.0040.00416.94
8.0.250.0020.00517.21
8.0.240.0080.00017.18
8.0.230.0040.00417.13
8.0.220.0040.00417.06
8.0.210.0030.00517.06
8.0.200.0000.00717.21
8.0.190.0090.00017.22
8.0.180.0080.00017.16
8.0.170.0040.00417.20
8.0.160.0050.00317.05
8.0.150.0000.00817.13
8.0.140.0040.00417.13
8.0.130.0000.00613.61
8.0.120.0040.00417.13
8.0.110.0040.00417.14
8.0.100.0030.00517.14
8.0.90.0030.00517.19
8.0.80.0560.01217.12
8.0.70.0040.00417.04
8.0.60.0040.00417.06
8.0.50.0080.00017.16
8.0.30.0110.00717.19
8.0.20.0070.01217.48
8.0.10.0030.00517.16
8.0.00.0110.00817.11
7.4.330.0070.00015.55
7.4.320.0000.00716.87
7.4.300.0030.00316.67
7.4.290.0000.00816.71
7.4.280.0090.00016.67
7.4.270.0030.00516.77
7.4.260.0000.00816.70
7.4.250.0000.00916.68
7.4.240.0070.00016.70
7.4.230.0000.00716.77
7.4.220.0100.01716.90
7.4.210.0100.00716.73
7.4.200.0000.00716.82
7.4.160.0070.00916.58
7.4.150.0180.00717.40
7.4.140.0120.01017.86
7.4.130.0150.00716.64
7.4.120.0100.01216.69
7.4.110.0060.01016.66
7.4.100.0090.01516.63
7.4.90.0100.00716.55
7.4.80.0120.00919.39
7.4.70.0130.00316.85
7.4.60.0070.01016.83
7.4.50.0030.01016.80
7.4.40.0080.00916.62
7.4.30.0090.00916.79
7.4.00.0100.00715.19
7.3.330.0050.00013.58
7.3.320.0000.00713.41
7.3.310.0060.00316.63
7.3.300.0050.00216.60
7.3.290.0090.00716.55
7.3.280.0080.00916.58
7.3.270.0110.00717.40
7.3.260.0100.00816.66
7.3.250.0100.00916.64
7.3.240.0080.01016.78
7.3.230.0040.01416.57
7.3.210.0090.00916.94
7.3.200.0110.00516.79
7.3.190.0130.00316.59
7.3.180.0060.01916.79
7.3.170.0060.01516.60
7.3.160.0100.00716.64
7.3.10.0070.00716.84
7.3.00.0000.01016.67
7.2.330.0090.00917.08
7.2.320.0100.01316.79
7.2.310.0080.01217.06
7.2.300.0120.00616.87
7.2.290.0110.00617.07
7.2.130.0030.01016.69
7.2.120.0090.00316.93
7.2.110.0060.01016.70
7.2.100.0060.00916.65
7.2.90.0030.01017.12
7.2.80.0140.00317.03
7.2.70.0070.01016.88
7.2.60.0050.00916.90
7.2.50.0070.01116.80
7.2.40.0090.00916.98
7.2.30.0030.01717.18
7.2.20.0110.00416.95
7.2.10.0080.00817.04
7.2.00.0060.00818.24
7.1.250.0040.00816.10
7.1.200.0120.00016.14
7.1.100.0000.01218.32
7.1.70.2140.02015.71
7.1.60.0440.01433.65
7.1.50.0450.00633.12
7.1.40.0260.00934.59
7.1.30.0470.02032.92
7.1.20.0240.00934.80
7.1.10.0220.01014.98
7.1.00.0000.01516.88
7.0.200.0140.00716.99
7.0.190.0190.01614.96
7.0.180.0080.01316.35
7.0.170.0050.01516.38
7.0.160.0130.00416.56
7.0.150.0270.00316.47
7.0.140.0290.00614.72
7.0.130.0260.01615.02
7.0.120.0000.02016.57
7.0.110.0250.00714.79
7.0.100.0360.01314.73
7.0.90.0200.01214.73
7.0.80.0220.01316.38
7.0.70.0180.01214.72
7.0.60.0090.00616.20
7.0.50.0040.01616.43
7.0.40.0040.01216.64
7.0.30.0210.00914.84
7.0.20.0060.00916.43
7.0.10.0070.00716.58
7.0.00.0100.00316.64

preferences:
49.87 ms | 401 KiB | 5 Q