3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<html> <body> <table> <thead> <tr> <th>Name</th> <th>Date</th> </tr> </thead> <tbody> <tr> <td>Chad</td> <td>10/23/1996</td> </tr> <tr> <td>Rebecca</td> <td>05/03/2001</td> </tbody> </table> </body> </html>'; $dom = new DOMDocument(); $dom->loadHTML($html); $headers = $dom->getElementsByTagName('th'); foreach($headers as $header) { $keys[] = strtolower($header->nodeValue); } $rows = $dom->getElementsByTagName('tbody')->item(0)->getElementsByTagName('tr'); $result = []; foreach($rows as $row) { $item = []; foreach($keys as $i => $key) { $cells = $row->getElementsByTagName('td'); $item[$key] = $cells->item($i)->nodeValue; } $result[] = $item; } var_dump($result);

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.00717.00
8.3.50.0110.00418.37
8.3.40.0090.00919.15
8.3.30.0070.00718.96
8.3.20.0080.00019.59
8.3.10.0000.00821.93
8.3.00.0000.00820.80
8.2.180.0100.00716.50
8.2.170.0120.00622.96
8.2.160.0070.01119.61
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00020.01
8.2.120.0050.00326.35
8.2.110.0070.00322.28
8.2.100.0040.00819.88
8.2.90.0040.00421.13
8.2.80.0030.00518.98
8.2.70.0000.00817.88
8.2.60.0040.00417.88
8.2.50.0050.00318.18
8.2.40.0040.00418.05
8.2.30.0040.00419.59
8.2.20.0070.00018.35
8.2.10.0040.00418.38
8.2.00.0050.00317.94
8.1.280.0120.00325.92
8.1.270.0040.00423.90
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00320.70
8.1.230.0040.00717.95
8.1.220.0050.00318.02
8.1.210.0000.00918.77
8.1.200.0030.00517.61
8.1.190.0000.00919.26
8.1.180.0040.00418.10
8.1.170.0060.00317.82
8.1.160.0030.00519.10
8.1.150.0000.00719.11
8.1.140.0040.00422.37
8.1.130.0050.00520.46
8.1.120.0030.00317.64
8.1.110.0030.00717.57
8.1.100.0000.00717.56
8.1.90.0040.00417.70
8.1.80.0050.00317.67
8.1.70.0040.00417.59
8.1.60.0030.00517.79
8.1.50.0000.00917.74
8.1.40.0050.00317.63
8.1.30.0080.00017.81
8.1.20.0020.00517.91
8.1.10.0050.00217.77
8.1.00.0000.00817.70
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0050.00518.58
8.0.270.0040.00417.49
8.0.260.0030.00318.52
8.0.250.0040.00417.20
8.0.240.0030.00517.06
8.0.230.0070.00017.09
8.0.220.0040.00417.05
8.0.210.0070.00016.97
8.0.200.0080.00017.09
8.0.190.0000.00717.05
8.0.180.0050.00317.16
8.0.170.0060.00317.11
8.0.160.0000.00817.14
8.0.150.0050.00217.01
8.0.140.0000.00717.07
8.0.130.0060.00013.44
8.0.120.0020.00516.96
8.0.110.0050.00317.14
8.0.100.0000.00716.97
8.0.90.0040.00417.05
8.0.80.0070.00817.21
8.0.70.0040.00417.04
8.0.60.0070.00017.10
8.0.50.0080.00017.04
8.0.30.0060.01417.13
8.0.20.0110.00917.49
8.0.10.0000.00817.28
8.0.00.0080.01117.03
7.4.330.0020.00215.55
7.4.320.0000.00716.80
7.4.300.0000.00716.84
7.4.290.0050.00216.73
7.4.280.0070.00416.89
7.4.270.0030.00516.70
7.4.260.0030.00316.70
7.4.250.0000.00716.78
7.4.240.0000.00716.72
7.4.230.0030.00316.57
7.4.220.0040.00416.55
7.4.210.0060.00916.90
7.4.200.0040.00416.46
7.4.160.0090.00716.70
7.4.140.0110.00817.86
7.4.130.0150.00416.71
7.4.120.0100.00916.70
7.4.110.0110.00616.80
7.4.100.0120.00616.62
7.4.90.0090.00816.83
7.4.80.0090.01519.39
7.4.70.0110.00716.71
7.4.60.0100.01416.71
7.4.50.0060.01016.45
7.4.40.0090.01216.66
7.4.10.0030.01515.15
7.4.00.0090.00615.08
7.3.330.0000.00613.43
7.3.320.0000.00513.44
7.3.310.0000.00916.58
7.3.300.0030.00316.53
7.3.290.0030.01016.60
7.3.280.0090.00916.54
7.3.260.0100.01116.69
7.3.240.0080.01116.67
7.3.230.0090.00916.77
7.3.210.0030.01416.75
7.3.200.0150.00316.68
7.3.190.0030.02016.86
7.3.180.0150.00616.88
7.3.170.0140.00616.72
7.3.160.0110.01116.48
7.3.130.0060.01315.04
7.3.120.0050.01315.04
7.3.110.0100.00614.90
7.3.100.0030.00914.99
7.3.90.0080.00714.73
7.3.80.0040.00814.89
7.3.70.0070.00714.98
7.3.60.0030.01014.94
7.3.50.0030.01215.05
7.3.40.0050.00914.84
7.3.30.0030.00714.72
7.3.20.0040.00616.84
7.3.10.0080.00716.65
7.3.00.0040.01016.67
7.2.330.0100.00716.87
7.2.320.0150.00317.07
7.2.310.0090.00816.93
7.2.300.0060.01116.93
7.2.290.0090.00916.75
7.2.260.0090.00915.10
7.2.250.0070.01315.12
7.2.240.0080.00815.06
7.2.230.0050.00814.98
7.2.220.0020.01115.28
7.2.210.0050.00915.21
7.2.200.0040.01015.01
7.2.190.0040.00815.16
7.2.180.0050.00815.20
7.2.170.0000.01115.27
7.2.160.0020.01315.11
7.2.150.0080.00716.96
7.2.140.0070.00517.11
7.2.130.0050.00917.11
7.2.120.0040.01217.13
7.2.110.0090.01016.27
7.2.100.0130.00516.35
7.2.90.0120.00816.35
7.2.80.0120.00816.25
7.2.70.0110.01116.34
7.2.60.0150.00616.35
7.2.50.0140.01116.41
7.2.40.0170.00516.52
7.2.30.0130.00816.38
7.2.20.0130.01116.37
7.2.10.0120.00616.43
7.2.00.0180.00716.38
7.1.330.0060.00615.96
7.1.320.0030.00716.01
7.1.310.0050.00915.95
7.1.300.0060.01015.90
7.1.290.0070.00815.90
7.1.280.0030.01015.96
7.1.270.0060.00615.89
7.1.260.0050.00615.81
7.1.250.0030.00815.93
7.1.240.0040.01115.85
7.1.230.0180.01014.83
7.1.220.0640.00514.98
7.1.210.0190.00514.88
7.1.200.0310.01115.11
7.1.190.0210.00915.01
7.1.180.0210.00714.93
7.1.170.0230.00814.95
7.1.160.0160.00814.93
7.1.150.0160.01015.05
7.1.140.0200.00414.98
7.1.130.0160.00715.01
7.1.120.0260.00514.92
7.1.110.0590.00614.86
7.1.100.0220.00714.92
7.1.90.0160.00714.98
7.1.80.0230.00615.01
7.1.70.0260.01014.90
7.1.60.0300.01423.98
7.1.50.0310.00723.90
7.1.40.0340.00523.87
7.1.30.0400.00924.02
7.1.20.0470.00723.96
7.1.10.0280.01014.88
7.1.00.0180.01115.06
7.0.330.0070.00315.62
7.0.320.0070.00315.31
7.0.310.0060.00615.24
7.0.300.0030.00715.27
7.0.290.0090.00615.54
7.0.280.0130.00315.28
7.0.270.0030.01015.41
7.0.260.0040.01415.48
7.0.250.0060.00915.27
7.0.240.0070.01015.47
7.0.230.0050.00515.47
7.0.220.0100.00315.48
7.0.210.0040.01115.67
7.0.200.0100.00315.38
7.0.190.0000.01515.61
7.0.180.0000.01015.40
7.0.170.0030.00715.68
7.0.160.0080.00515.65
7.0.150.0070.00715.60
7.0.140.0000.01215.68
7.0.130.0110.00015.68
7.0.120.0030.00915.35
7.0.110.0090.00315.20
7.0.100.0080.00015.25
7.0.90.0140.00015.49
7.0.80.0070.00315.54
7.0.70.0030.00715.59
7.0.60.0070.00315.75
7.0.50.0090.00315.87
7.0.40.0000.00913.70
7.0.30.0080.00413.48
7.0.20.0120.00313.61
7.0.10.0060.00913.67
7.0.00.0050.00313.61
5.6.400.0030.01014.18
5.6.390.0030.00614.39
5.6.380.0060.00814.71
5.6.370.0030.01314.16
5.6.360.0000.01114.64
5.6.350.0060.00314.43
5.6.340.0030.01414.73
5.6.330.0030.01014.42
5.6.320.0060.01214.51
5.6.310.0030.00714.70
5.6.300.0030.01014.42
5.6.290.0030.00714.18
5.6.280.0030.00914.58
5.6.270.0030.00914.11
5.6.260.0050.00514.89
5.6.250.0030.00714.42
5.6.240.0140.00314.40
5.6.230.0090.00914.50
5.6.220.0000.01314.25
5.6.210.0060.00314.74
5.6.200.0030.00714.79
5.6.190.0000.01014.50
5.6.180.0000.00814.35
5.6.170.0060.00914.32
5.6.160.0070.00714.77
5.6.150.0040.01114.44
5.6.140.0080.00314.72
5.6.130.0000.00814.40
5.6.120.0040.00414.76
5.6.110.0070.00714.25
5.6.100.0040.01114.51
5.6.90.0120.00314.38
5.6.80.0040.01114.25
5.6.70.0080.00814.65
5.6.60.0060.00614.62
5.6.50.0030.01414.45
5.6.40.0030.00614.30
5.6.30.0100.00014.33
5.6.20.0120.00314.73
5.6.10.0040.01214.32
5.6.00.0030.00714.33

preferences:
44.88 ms | 400 KiB | 5 Q