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)->getElementsByTagName('td'); $resultArray = []; $keys = []; foreach($headers as $header) { $keys[] = strtolower($header->nodeValue); } foreach($rows as $i => $row) { if ($i<1) {continue;} $item = []; foreach($keys as $j=>$key) { $cells = $row->getElementsByTagName('td'); $item[$key] = $cells->item($j)->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.0140.00317.00
8.3.50.0090.00618.47
8.3.40.0110.00418.96
8.3.30.0120.00319.10
8.3.20.0040.00419.68
8.3.10.0030.00622.07
8.3.00.0000.00820.75
8.2.180.0060.01218.42
8.2.170.0040.01222.96
8.2.160.0090.01319.45
8.2.150.0040.00424.18
8.2.140.0070.00324.66
8.2.130.0080.00018.53
8.2.120.0080.00026.35
8.2.110.0030.00619.36
8.2.100.0090.00318.22
8.2.90.0080.00017.88
8.2.80.0030.00617.97
8.2.70.0030.00618.18
8.2.60.0030.00618.59
8.2.50.0000.00818.10
8.2.40.0080.00019.90
8.2.30.0000.00819.68
8.2.20.0080.00018.43
8.2.10.0000.00718.48
8.2.00.0060.00318.00
8.1.280.0140.00725.92
8.1.270.0060.00319.15
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0050.00522.72
8.1.230.0070.00322.50
8.1.220.0050.00317.93
8.1.210.0030.00618.77
8.1.200.0030.00617.60
8.1.190.0030.00517.48
8.1.180.0060.00318.10
8.1.170.0040.00418.99
8.1.160.0070.00019.14
8.1.150.0050.00219.21
8.1.140.0080.00022.34
8.1.130.0030.00620.51
8.1.120.0040.00417.76
8.1.110.0050.00317.60
8.1.100.0080.00017.78
8.1.90.0030.00517.74
8.1.80.0040.00417.71
8.1.70.0070.00017.75
8.1.60.0090.00017.77
8.1.50.0040.00417.77
8.1.40.0000.00917.75
8.1.30.0000.00817.93
8.1.20.0040.00418.01
8.1.10.0040.00417.78
8.1.00.0040.00417.79
8.0.300.0040.00418.77
8.0.290.0080.00017.00
8.0.280.0070.00018.76
8.0.270.0050.00217.56
8.0.260.0040.00418.71
8.0.250.0000.00717.15
8.0.240.0040.00417.23
8.0.230.0030.00717.11
8.0.220.0050.00517.05
8.0.210.0030.00317.16
8.0.200.0060.00317.26
8.0.190.0030.00617.12
8.0.180.0000.00817.12
8.0.170.0060.00317.14
8.0.160.0000.00717.16
8.0.150.0050.00217.02
8.0.140.0040.00417.16
8.0.130.0060.00013.57
8.0.120.0080.00017.02
8.0.110.0040.00417.03
8.0.100.0040.00417.18
8.0.90.0040.00417.12
8.0.80.0090.00917.13
8.0.70.0000.00817.13
8.0.60.0000.00716.99
8.0.50.0060.00317.15
8.0.30.0090.01017.34
8.0.20.0120.00717.61
8.0.10.0040.00417.16
8.0.00.0110.01017.19
7.4.330.0000.00615.55
7.4.320.0000.00616.88
7.4.300.0030.00316.98
7.4.290.0070.00016.85
7.4.280.0060.00316.80
7.4.270.0040.00416.69
7.4.260.0030.00616.71
7.4.250.0000.00716.63
7.4.240.0040.00416.71
7.4.230.0000.00816.93
7.4.220.0030.00516.90
7.4.210.0030.01216.85
7.4.200.0000.00716.98
7.4.160.0070.00916.81
7.4.140.0080.01017.86
7.4.130.0100.01016.97
7.4.120.0070.01216.76
7.4.110.0100.01316.69
7.4.100.0070.01116.73
7.4.90.0060.01116.64
7.4.80.0070.01019.39
7.4.70.0110.00616.86
7.4.60.0170.00016.99
7.4.50.0160.00016.66
7.4.40.0080.01116.98
7.4.00.0110.00415.26
7.3.330.0000.00513.30
7.3.320.0000.00613.42
7.3.310.0030.00616.46
7.3.300.0040.00416.57
7.3.290.0000.00816.59
7.3.280.0070.01416.66
7.3.260.0120.00716.64
7.3.240.0110.00816.59
7.3.230.0130.00316.71
7.3.210.0110.00716.65
7.3.200.0130.00917.00
7.3.190.0110.01116.79
7.3.180.0030.01416.82
7.3.170.0090.00916.70
7.3.160.0060.01316.89
7.2.330.0030.01916.87
7.2.320.0060.01217.05
7.2.310.0150.00316.75
7.2.300.0080.00816.92
7.2.290.0150.01016.84
7.2.110.0030.01216.58
7.2.100.0050.00816.51
7.2.90.0040.01116.78
7.2.80.0060.00816.70
7.2.70.0080.00716.73
7.2.60.0060.00916.81
7.2.50.0070.00817.11
7.2.40.0070.01116.93
7.2.30.0120.00316.98
7.2.20.0080.00816.63
7.2.10.0060.00916.78
7.2.00.0070.01016.68
7.1.230.0030.01015.65
7.1.220.0050.00815.39
7.1.210.0050.00715.88
7.1.200.0040.00915.69
7.1.190.0040.00815.46
7.1.180.0080.00715.71
7.1.170.0050.01015.89
7.1.160.0080.00615.52
7.1.150.0040.01015.75
7.1.140.0060.00815.89
7.1.130.0080.00515.70
7.1.120.0090.00415.66
7.1.110.0090.00415.79
7.1.100.0050.00815.75
7.1.90.0090.00415.72
7.1.80.0100.00315.76
7.1.70.0030.00715.73
7.1.60.0260.00933.76
7.1.50.0210.01233.64
7.1.40.0230.01033.57
7.1.30.0220.00733.69
7.1.20.0160.01633.70
7.1.10.0080.00515.78
7.1.00.0050.00715.65
5.6.380.0100.00414.43

preferences:
63.21 ms | 400 KiB | 5 Q