3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); $currentDateTime = new DateTime(); $url = 'https://www.lmsal.com/hek/hcr?cmd=view-planned-events&instrument=iris'; $content = file_get_contents($url); $dom = new DOMDocument(); @$dom->loadHTML($content); $table = $dom->getElementsByTagName('table')->item(0); $rows = $table->getElementsByTagName('tr'); foreach($rows as $row) { $columns = $row->getElementsByTagName('td'); if ($columns->length > 0) { $dateTimeRange = $columns->item(0)->nodeValue; // Match the pattern "YYYY-MM-DD HH:MM:SS - HH:MM:SS" and store the matches in $matches array preg_match_all('/\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}-\d{2}:\d{2}:\d{2}/', $dateTimeRange, $matches); foreach ($matches[0] as $match) { list($start, $end) = explode("-", $match); $startDateTime = DateTime::createFromFormat('Y-m-d H:i:s', trim($start)); $endDateTime = DateTime::createFromFormat('Y-m-d H:i:s', trim($end)); // If the current time is within the start and end times, print it out if ($startDateTime <= $currentDateTime && $currentDateTime <= $endDateTime) { echo $match . '<br>'; } } } } ?>

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.0130.01017.00
8.3.50.0060.00917.11
8.3.40.0100.00320.27
8.3.30.0150.00019.06
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.180.0130.00717.00
8.2.170.0100.00619.16
8.2.160.0090.00622.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.70
8.2.110.0070.00322.11
8.2.100.0060.00618.03
8.2.90.0040.00418.00
8.2.80.0040.00418.86
8.2.70.0080.00017.88
8.2.60.0200.00017.63
8.2.50.0160.00317.75
8.2.40.0130.00417.50
8.2.30.0130.00417.38
8.2.20.0080.00817.63
8.2.10.0080.00817.63
8.2.00.0120.00418.00
8.1.280.0120.00625.92
8.1.270.0000.00824.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00920.27
8.1.230.0090.00317.95
8.1.220.0050.00517.89
8.1.210.0000.00918.77
8.1.200.0000.00817.48
8.1.190.0170.00017.50
8.1.180.0080.00817.50
8.1.170.0130.00317.13
8.1.160.0090.00817.38
8.1.150.0150.00317.25
8.1.140.0080.00917.25
8.1.130.0170.00017.25
8.1.120.0130.00417.38
8.1.110.0070.01017.13
8.1.100.0040.01317.50
8.1.90.0100.00717.38
8.1.80.0140.00217.36
8.1.70.0090.00717.48
8.1.60.0140.00517.63
8.1.50.0170.00317.38
8.1.40.0210.00517.38
8.1.30.0140.00517.50
8.1.20.0170.00317.38
8.1.10.0190.00017.25
8.1.00.0120.00617.50
8.0.300.0000.00918.77
8.0.290.0040.00417.00
8.0.280.0160.00016.71
8.0.270.0110.00616.75
8.0.260.0100.00517.00
8.0.250.0060.01116.63
8.0.240.0060.00916.72
8.0.230.0080.00816.75
8.0.220.0160.00016.75
8.0.210.0120.00416.52
8.0.200.0100.00717.00
8.0.190.0170.00016.88
8.0.180.0140.00317.10
8.0.170.0130.00316.88
8.0.160.0180.00017.13
8.0.150.0120.00616.96
8.0.140.0140.00316.88
8.0.130.0080.00816.75
8.0.120.0060.01216.75
8.0.110.0130.00317.13
8.0.100.0180.00016.73
8.0.90.0170.00016.88
8.0.80.0140.00517.00
8.0.70.0050.01116.75
8.0.60.0170.00016.74
8.0.50.0170.00016.88
8.0.30.0060.01116.61
8.0.20.0190.00016.88
8.0.10.0060.01116.73

preferences:
36.2 ms | 401 KiB | 5 Q