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 = []; $cells = $row->getElementsByTagName('td'); foreach($keys as $i => $key) { $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.0170.00016.88
8.3.50.0090.00618.20
8.3.40.0100.01619.04
8.3.30.0110.00418.88
8.3.20.0040.00419.54
8.3.10.0030.00523.79
8.3.00.0040.00420.81
8.2.180.0140.00416.75
8.2.170.0040.01122.96
8.2.160.0120.00619.63
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0000.00820.08
8.2.120.0040.00426.35
8.2.110.0000.01020.74
8.2.100.0000.01117.97
8.2.90.0080.00017.88
8.2.80.0000.00917.97
8.2.70.0080.00018.02
8.2.60.0000.00818.28
8.2.50.0060.00318.10
8.2.40.0050.00319.59
8.2.30.0000.00719.48
8.2.20.0040.00418.35
8.2.10.0040.00418.38
8.2.00.0060.00317.94
8.1.280.0070.00725.92
8.1.270.0030.00619.12
8.1.260.0050.00326.35
8.1.250.0030.00628.09
8.1.240.0090.00024.04
8.1.230.0040.00724.01
8.1.220.0000.01017.91
8.1.210.0030.00518.77
8.1.200.0040.00417.49
8.1.190.0000.00817.48
8.1.180.0000.00818.10
8.1.170.0110.00018.74
8.1.160.0000.00719.06
8.1.150.0000.00719.13
8.1.140.0040.00422.29
8.1.130.0060.00317.75
8.1.120.0040.00417.70
8.1.110.0000.00817.61
8.1.100.0000.00717.69
8.1.90.0040.00417.64
8.1.80.0000.00717.69
8.1.70.0000.00717.71
8.1.60.0040.00417.75
8.1.50.0000.00817.82
8.1.40.0050.00317.67
8.1.30.0050.00317.77
8.1.20.0030.00617.89
8.1.10.0030.00517.82
8.1.00.0000.00817.73
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0050.00218.64
8.0.270.0090.00017.00
8.0.260.0070.00017.04
8.0.250.0000.00717.13
8.0.240.0050.00317.19
8.0.230.0040.00417.05
8.0.220.0030.00316.99
8.0.210.0030.00317.09
8.0.200.0000.00817.00
8.0.190.0000.00917.18
8.0.180.0000.00817.05
8.0.170.0030.00517.05
8.0.160.0000.00717.16
8.0.150.0080.00016.96
8.0.140.0000.00717.14
8.0.130.0030.00313.51
8.0.120.0040.00417.07
8.0.110.0030.00517.07
8.0.100.0000.00817.03
8.0.90.0000.00717.02
8.0.80.0080.00717.05
8.0.70.0070.00017.25
8.0.60.0040.00416.89
8.0.50.0070.00016.86
8.0.30.0120.00717.22
8.0.20.0100.01117.40
8.0.10.0080.00017.09
8.0.00.0130.00716.97
7.4.330.0000.00615.55
7.4.320.0060.00016.88
7.4.300.0070.00016.88
7.4.290.0040.00416.79
7.4.280.0070.00316.66
7.4.270.0050.00316.75
7.4.260.0030.00516.68
7.4.250.0000.00716.85
7.4.240.0040.00416.68
7.4.230.0000.00716.86
7.4.220.0060.00316.88
7.4.210.0080.01116.85
7.4.200.0070.00016.91
7.4.160.0100.01016.61
7.4.140.0130.00717.86
7.4.130.0060.01116.64
7.4.120.0110.00816.77
7.4.110.0170.00016.54
7.4.100.0090.00916.83
7.4.90.0140.00616.73
7.4.80.0090.00919.39
7.4.70.0150.00416.75
7.4.60.0160.00316.53
7.4.50.0140.00416.47
7.4.40.0130.00316.61
7.4.00.0110.00714.79
7.3.330.0050.00013.34
7.3.320.0030.00313.39
7.3.310.0050.00316.55
7.3.300.0030.00316.50
7.3.290.0030.00316.50
7.3.280.0090.01016.54
7.3.260.0120.01016.68
7.3.240.0080.00916.62
7.3.230.0120.00616.57
7.3.210.0070.01016.73
7.3.200.0030.01716.80
7.3.190.0130.00616.48
7.3.180.0090.00916.84
7.3.170.0140.00316.47
7.3.160.0210.00316.54
7.2.330.0030.01516.91
7.2.320.0060.01216.71
7.2.310.0100.00716.86
7.2.300.0090.01216.87
7.2.290.0130.00316.87
7.2.110.0610.00314.49
7.2.100.0600.00014.76
7.2.90.0620.01015.02
7.2.80.0560.01314.88
7.2.70.1560.01014.95
7.2.60.0750.01314.90
7.2.50.0780.00315.16
7.2.40.0610.01315.04
7.2.30.0650.01014.89
7.2.20.0570.01115.25
7.2.10.1040.00714.93
7.2.00.0680.00314.94
7.1.230.0610.00713.96
7.1.220.0600.00614.01
7.1.210.0550.01014.05
7.1.200.0840.01013.75
7.1.190.0940.01013.80
7.1.180.0560.01213.88
7.1.170.0790.00613.60
7.1.160.0630.00613.83
7.1.150.1210.00313.75
7.1.140.0590.01013.65
7.1.130.0780.00313.88
7.1.120.0790.00013.90
7.1.110.0730.01013.98
7.1.100.0750.00713.75
7.1.90.0590.00713.90
7.1.80.0600.00014.04
7.1.70.0780.00714.04
7.1.60.0630.02031.86
7.1.50.0990.00731.81
7.1.40.1040.02132.07
7.1.30.1280.01331.92
7.1.20.0270.01231.84
7.1.10.0210.01213.91
7.1.00.0100.01013.84
5.6.380.0100.00614.20

preferences:
61.04 ms | 400 KiB | 5 Q