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[] = $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.70.0070.00716.86
8.3.60.0070.01417.00
8.3.50.0040.01118.21
8.3.40.0090.00918.97
8.3.30.0000.01419.04
8.3.20.0050.00319.62
8.3.10.0000.00921.98
8.3.00.0080.00020.93
8.2.180.0140.00316.75
8.2.170.0110.00722.96
8.2.160.0070.01019.65
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00418.21
8.2.120.0080.00026.35
8.2.110.0090.00021.24
8.2.100.0070.00718.16
8.2.90.0000.00818.22
8.2.80.0060.00318.34
8.2.70.0030.00617.75
8.2.60.0060.00317.88
8.2.50.0040.00417.88
8.2.40.0030.00520.14
8.2.30.0050.00219.41
8.2.20.0050.00218.41
8.2.10.0000.00718.35
8.2.00.0030.00617.83
8.1.280.0040.01125.92
8.1.270.0070.01320.57
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0030.00624.05
8.1.230.0080.00322.98
8.1.220.0050.00317.91
8.1.210.0050.00318.89
8.1.200.0050.00317.60
8.1.190.0030.00617.48
8.1.180.0000.00818.10
8.1.170.0080.00017.62
8.1.160.0000.00719.05
8.1.150.0000.00719.18
8.1.140.0030.00322.40
8.1.130.0070.00320.28
8.1.120.0050.00217.70
8.1.110.0030.00717.69
8.1.100.0070.00017.55
8.1.90.0000.00717.72
8.1.80.0000.00817.56
8.1.70.0050.00217.68
8.1.60.0060.00317.70
8.1.50.0040.00417.68
8.1.40.0000.00817.77
8.1.30.0060.00317.84
8.1.20.0040.00417.80
8.1.10.0000.00917.80
8.1.00.0000.00817.74
8.0.300.0040.00420.16
8.0.290.0000.00916.88
8.0.280.0000.00818.78
8.0.270.0000.00817.40
8.0.260.0000.00618.73
8.0.250.0000.00717.14
8.0.240.0000.00817.13
8.0.230.0080.00017.20
8.0.220.0070.00017.14
8.0.210.0030.00317.06
8.0.200.0040.00417.00
8.0.190.0060.00317.14
8.0.180.0000.00817.16
8.0.170.0000.01117.08
8.0.160.0040.00417.07
8.0.150.0070.00016.95
8.0.140.0060.00316.98
8.0.130.0000.00513.52
8.0.120.0070.00017.06
8.0.110.0000.00717.10
8.0.100.0070.00017.09
8.0.90.0030.00516.91
8.0.80.0040.01117.13
8.0.70.0040.00416.96
8.0.60.0040.00417.02
8.0.50.0040.00417.11
8.0.30.0100.00817.45
8.0.20.0110.00917.50
8.0.10.0000.00717.08
8.0.00.0130.01016.97
7.4.330.0000.00615.55
7.4.320.0000.00716.90
7.4.300.0070.00016.70
7.4.290.0000.00816.68
7.4.280.0030.00716.88
7.4.270.0000.00716.64
7.4.260.0000.01016.81
7.4.250.0080.00016.81
7.4.240.0040.00416.80
7.4.230.0070.00016.88
7.4.220.0000.00716.89
7.4.210.0070.00816.82
7.4.200.0000.00716.91
7.4.160.0100.00816.74
7.4.140.0070.01217.86
7.4.130.0100.00716.67
7.4.120.0080.01216.78
7.4.110.0110.00716.82
7.4.100.0070.01116.89
7.4.90.0100.01016.60
7.4.80.0060.01219.39
7.4.70.0180.00016.73
7.4.60.0070.01016.76
7.4.50.0070.00716.51
7.4.40.0070.01016.58
7.4.00.0060.01215.18
7.3.330.0030.00313.38
7.3.320.0060.00013.40
7.3.310.0000.00716.51
7.3.300.0000.00716.37
7.3.290.0030.00516.58
7.3.280.0130.00616.52
7.3.260.0120.00916.66
7.3.240.0100.00816.59
7.3.230.0090.00916.61
7.3.210.0130.00416.85
7.3.200.0090.00916.86
7.3.190.0070.01616.86
7.3.180.0130.01016.77
7.3.170.0100.01316.70
7.3.160.0070.01416.74
7.3.120.0140.00314.68
7.3.110.0100.01015.19
7.3.100.0040.01115.14
7.3.90.0080.00415.04
7.3.80.0030.01015.04
7.3.70.0040.00814.67
7.3.60.0030.00714.68
7.3.50.0030.01014.87
7.3.40.0030.01214.97
7.3.30.0050.00514.98
7.3.20.0130.00016.80
7.3.10.0040.01116.82
7.3.00.0070.00716.73
7.2.330.0000.02216.62
7.2.320.0130.01017.01
7.2.310.0060.01217.06
7.2.300.0100.00716.73
7.2.290.0130.00417.11
7.2.250.0140.00315.20
7.2.240.0030.01515.14
7.2.230.0030.01115.43
7.2.220.0100.00315.41
7.2.210.0090.00614.95
7.2.200.0110.00315.20
7.2.190.0000.01215.22
7.2.180.0060.01315.05
7.2.170.0090.00615.16
7.2.160.0060.00315.06
7.2.150.0060.01017.13
7.2.140.0030.00917.09
7.2.130.0060.00917.25
7.2.120.0070.00717.18
7.2.110.0110.00616.01
7.2.100.0100.00916.02
7.2.90.0120.00915.91
7.2.80.0140.00315.96
7.2.70.0210.00316.02
7.2.60.0090.01015.88
7.2.50.0170.01116.19
7.2.40.0140.00616.07
7.2.30.0160.00516.19
7.2.20.0180.00616.04
7.2.10.0130.00716.20
7.2.00.0210.00516.05
7.1.330.0130.00315.76
7.1.320.0060.00615.95
7.1.310.0030.00715.98
7.1.300.0080.00015.78
7.1.290.0070.00715.80
7.1.280.0060.01216.04
7.1.270.0070.00715.93
7.1.260.0070.00715.85
7.1.250.0060.00916.11
7.1.240.0130.00015.85
7.1.230.0110.00714.94
7.1.220.0120.01014.97
7.1.210.0140.00914.97
7.1.200.0120.00715.00
7.1.190.0080.00915.08
7.1.180.0160.01115.07
7.1.170.0220.00814.80
7.1.160.0130.00714.93
7.1.150.0150.00314.90
7.1.140.0140.00814.95
7.1.130.0110.00615.01
7.1.120.0150.00915.05
7.1.110.0120.01014.98
7.1.100.0120.00615.07
7.1.90.0270.00814.91
7.1.80.0150.00714.99
7.1.70.0130.00715.07
7.1.60.0160.01323.91
7.1.50.0170.01123.85
7.1.40.0180.01124.01
7.1.30.0200.01023.81
7.1.20.0240.00623.95
7.1.10.0140.00515.02
7.1.00.0190.00814.78
7.0.330.0030.01315.77
7.0.320.0120.00315.52
7.0.310.0060.00615.38
7.0.300.0050.00515.50
7.0.290.0060.00615.50
7.0.280.0030.01015.49
7.0.270.0040.01115.28
7.0.260.0090.00615.67
7.0.250.0030.01015.37
7.0.240.0090.00315.69
7.0.230.0000.01415.25
7.0.220.0070.00715.59
7.0.210.0000.01515.74
7.0.200.0030.00615.58
7.0.190.0060.00915.51
7.0.180.0070.00315.55
7.0.170.0070.00715.64
7.0.160.0110.00015.66
7.0.150.0000.01915.59
7.0.140.0040.01215.56
7.0.130.0040.00415.45
7.0.120.0040.00815.20
7.0.110.0090.00615.64
7.0.100.0000.01515.55
7.0.90.0030.01015.54
7.0.80.0040.00815.59
7.0.70.0000.01315.55
7.0.60.0060.00615.63
7.0.50.0000.01215.43
7.0.40.0040.00813.57
7.0.30.0000.00913.29
7.0.20.0000.01213.52
7.0.10.0000.01013.34
7.0.00.0080.00413.66
5.6.400.0000.00914.30
5.6.390.0030.01014.68
5.6.380.0040.00914.54
5.6.370.0000.01414.41
5.6.360.0060.00314.57
5.6.350.0030.00514.78
5.6.340.0110.00414.46
5.6.330.0030.01214.87
5.6.320.0140.00014.54
5.6.310.0040.00414.45
5.6.300.0170.00314.78
5.6.290.0070.01014.50
5.6.280.0000.01514.29
5.6.270.0110.00414.66
5.6.260.0030.01014.46
5.6.250.0030.01014.55
5.6.240.0090.00014.29
5.6.230.0060.00914.23
5.6.220.0030.00914.86
5.6.210.0030.00914.61
5.6.200.0040.01114.34
5.6.190.0000.01514.27
5.6.180.0030.00714.36
5.6.170.0040.00814.49
5.6.160.0030.01114.32
5.6.150.0030.01014.75
5.6.140.0000.00814.75
5.6.130.0000.01414.52
5.6.120.0100.00314.52
5.6.110.0060.00614.81
5.6.100.0090.00614.27
5.6.90.0070.00714.45
5.6.80.0060.00614.52
5.6.70.0100.00014.66
5.6.60.0040.00814.32
5.6.50.0070.00414.31
5.6.40.0070.00714.18
5.6.30.0040.01114.41
5.6.20.0070.01014.32
5.6.10.0030.00714.73
5.6.00.0070.00714.44

preferences:
48.36 ms | 400 KiB | 5 Q