3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<html> <body> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR> <TD BGCOLOR=000000> <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR STYLE="font-weight: 700;" ALIGN=CENTER BGCOLOR=99CCFF> <td>Product</td> <td>Quantity</td> <td>Retail Price</td> <td>Total Retail Price</td> <td>UPC</td> </tr> <tr bgcolor="FFFFFF"> <td style="">Smith High-Water Chroma Pop+ Polar Chromic NXT Sunglasses, Black</td> <td style="text-align: right;">1</td> <td style="text-align: right;">$259.00</td> <td style="text-align: right;">$259.00</td> <td style=""></td> </tr> <tr bgcolor="FFFFFF"> <td style="">Guest 2613A Charge Pro Series Marine Battery Charger (12/24-Volt, 15-Amps 5/5/5, Triple Output)</td> <td style="text-align: right;">1</td> <td style="text-align: right;">$179.18</td> <td style="text-align: right;">$179.18</td> <td style=""></td> </tr> </table> </body> </html>'; $dom = new DOMDocument(); $dom->loadHTML($html); // Grab first table from dom and store its rows and columns by tag name. $rows = $dom->getElementsByTagName('table')->item(1)->getElementsByTagName('tr'); $headers = $rows->item(0); $resultArray = []; $keys = []; foreach($headers as $header) { $keys[] = strtolower($cell->nodeValue); } print_r($keys); foreach($rows as $row) { $item = []; foreach($keys as $i=>$key) { $cells = $row->getElementsByTagName('td'); $item[$key] = $cells->item($i)->nodeValue; } $resultArray[] = $item; } print_r($resultArray);

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.0080.00818.80
8.3.50.0130.00318.32
8.3.40.0070.01119.17
8.3.30.0090.00619.09
8.3.20.0050.00319.72
8.3.10.0040.00422.08
8.3.00.0040.00420.96
8.2.180.0110.00418.76
8.2.170.0150.00022.96
8.2.160.0040.01521.14
8.2.150.0040.00424.18
8.2.140.0030.00724.66
8.2.130.0080.00018.41
8.2.120.0000.00826.35
8.2.110.0050.00519.50
8.2.100.0000.01118.09
8.2.90.0000.00818.00
8.2.80.0000.00817.97
8.2.70.0000.00818.29
8.2.60.0000.00818.47
8.2.50.0080.00018.10
8.2.40.0050.00319.73
8.2.30.0040.00419.45
8.2.20.0040.00418.45
8.2.10.0050.00318.39
8.2.00.0090.00018.11
8.1.280.0170.00325.92
8.1.270.0080.00019.20
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00622.73
8.1.230.0040.00822.31
8.1.220.0040.00417.92
8.1.210.0050.00318.77
8.1.200.0000.01017.73
8.1.190.0000.00817.73
8.1.180.0040.00418.10
8.1.170.0060.00318.94
8.1.160.0000.00719.21
8.1.150.0040.00419.09
8.1.140.0050.00222.50
8.1.130.0000.01020.32
8.1.120.0040.00417.71
8.1.110.0040.00417.70
8.1.100.0070.00017.77
8.1.90.0000.00917.73
8.1.80.0030.00517.70
8.1.70.0000.00717.65
8.1.60.0080.00017.86
8.1.50.0040.00417.86
8.1.40.0050.00317.81
8.1.30.0020.00518.00
8.1.20.0040.00417.89
8.1.10.0040.00417.84
8.1.00.0030.00617.80
8.0.300.0000.00818.77
8.0.290.0040.00417.00
8.0.280.0060.00318.66
8.0.270.0050.00317.49
8.0.260.0030.00318.76
8.0.250.0070.00017.14
8.0.240.0000.00817.27
8.0.230.0060.00317.25
8.0.220.0060.00317.12
8.0.210.0000.00717.09
8.0.200.0000.00817.27
8.0.190.0000.00817.13
8.0.180.0080.00017.19
8.0.170.0000.00917.19
8.0.160.0040.00417.08
8.0.150.0070.00017.10
8.0.140.0070.00017.16
8.0.130.0000.00613.59
8.0.120.0030.00517.00
8.0.110.0050.00317.02
8.0.100.0050.00317.17
8.0.90.0060.00317.13
8.0.80.0080.01317.14
8.0.70.0000.00817.23
8.0.60.0000.00817.20
8.0.50.0040.00417.16
8.0.30.0070.01217.44
8.0.20.0090.00917.40
8.0.10.0000.00717.30
8.0.00.0080.01117.13
7.4.330.0050.00015.55
7.4.320.0000.00616.74
7.4.300.0000.00716.75
7.4.290.0040.00416.95
7.4.280.0000.01016.72
7.4.270.0000.00716.84
7.4.260.0040.00416.75
7.4.250.0000.00716.91
7.4.240.0040.00416.71
7.4.230.0040.00316.67
7.4.220.0040.00416.83
7.4.210.0070.01116.92
7.4.200.0030.00316.54
7.4.160.0110.00716.77
7.4.140.0090.00917.86
7.4.130.0070.01316.56
7.4.120.0090.00916.76
7.4.110.0120.00816.66
7.4.100.0120.00616.84
7.4.90.0130.00416.71
7.4.80.0090.00919.39
7.4.70.0060.01216.67
7.4.60.0060.01616.66
7.4.50.0030.01416.73
7.4.40.0160.00816.68
7.4.00.0050.01115.15
7.3.330.0030.00313.24
7.3.320.0060.00013.33
7.3.310.0040.00416.38
7.3.300.0030.00416.35
7.3.290.0080.00016.52
7.3.280.0100.01016.46
7.3.260.0090.01116.65
7.3.240.0120.00916.62
7.3.230.0070.01016.51
7.3.210.0130.00316.44
7.3.200.0030.01316.49
7.3.190.0060.01116.59
7.3.180.0130.00316.57
7.3.170.0150.00316.57
7.3.160.0120.00916.75
7.3.120.0070.01115.20
7.3.110.0070.01014.88
7.3.100.0130.00314.73
7.3.90.0030.01014.80
7.3.80.0000.01014.85
7.3.70.0060.00614.73
7.3.60.0030.00914.84
7.3.50.0000.00915.00
7.3.40.0040.00814.80
7.3.30.0030.01014.68
7.3.20.0090.00616.77
7.3.10.0040.00916.91
7.3.00.0020.00816.66
7.2.330.0130.00716.88
7.2.320.0100.01017.00
7.2.310.0060.00917.03
7.2.300.0040.01217.05
7.2.290.0110.01116.78
7.2.250.0030.01514.94
7.2.240.0030.01315.09
7.2.230.0000.01615.14
7.2.220.0000.01515.31
7.2.210.0070.00715.22
7.2.200.0070.00715.02
7.2.190.0110.00415.03
7.2.180.0000.01214.83
7.2.170.0090.00615.22
7.2.130.0090.00317.00
7.2.120.0060.00617.18
7.2.110.0220.00515.59
7.2.100.0200.00615.44
7.2.90.0150.01015.66
7.2.80.0170.01015.62
7.2.70.0320.01015.58
7.2.60.0180.00615.58
7.2.50.0210.00715.80
7.2.40.0230.00715.63
7.2.30.0200.00915.61
7.2.20.0200.00715.77
7.2.10.0170.00615.63
7.2.00.0220.00515.57
7.1.330.0060.00915.79
7.1.320.0110.00415.90
7.1.310.0040.00815.83
7.1.300.0070.00315.79
7.1.290.0060.00616.05
7.1.280.0130.00015.97
7.1.270.0000.01415.95
7.1.260.0030.01015.70
7.1.250.0000.01015.62
7.1.230.0220.00514.03
7.1.220.0250.00913.90
7.1.210.0220.00613.91
7.1.200.0300.00513.82
7.1.190.0290.00513.74
7.1.180.0190.01014.03
7.1.170.0260.01313.91
7.1.160.0220.00613.75
7.1.150.0180.01113.73
7.1.140.0270.00214.01
7.1.130.0260.00713.97
7.1.120.0270.00513.87
7.1.110.0310.00613.84
7.1.100.0240.00913.79
7.1.90.0520.00814.02
7.1.80.0270.00213.74
7.1.70.0190.00613.93
7.1.60.0500.01031.79
7.1.50.0480.00731.70
7.1.40.0360.01131.90
7.1.30.0480.00931.67
7.1.20.0430.01331.82
7.1.10.0280.00314.09
7.1.00.0290.00813.99
5.6.380.0110.00614.57

preferences:
54.29 ms | 400 KiB | 5 Q