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); } print_r($keys); 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.70.0070.01416.88
8.3.60.0090.00918.43
8.3.50.0150.00318.23
8.3.40.0060.00918.92
8.3.30.0130.00318.92
8.3.20.0000.00819.60
8.3.10.0040.00422.01
8.3.00.0080.00020.83
8.2.190.0190.00317.02
8.2.180.0150.00018.68
8.2.170.0120.00322.96
8.2.160.0210.00019.12
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00818.32
8.2.120.0050.00326.35
8.2.110.0030.00719.52
8.2.100.0120.00018.22
8.2.90.0030.00518.13
8.2.80.0040.00417.97
8.2.70.0060.00318.18
8.2.60.0040.00418.53
8.2.50.0040.00418.10
8.2.40.0050.00319.74
8.2.30.0000.00719.65
8.2.20.0030.00518.45
8.2.10.0040.00418.42
8.2.00.0050.00517.98
8.1.280.0140.00725.92
8.1.270.0060.00319.38
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00422.71
8.1.230.0080.00422.37
8.1.220.0040.00418.04
8.1.210.0030.00618.77
8.1.200.0050.00517.85
8.1.190.0040.00417.50
8.1.180.0090.00018.10
8.1.170.0080.00018.82
8.1.160.0050.00319.21
8.1.150.0000.00819.10
8.1.140.0000.00722.34
8.1.130.0070.00420.46
8.1.120.0040.00417.72
8.1.110.0080.00017.64
8.1.100.0040.00417.66
8.1.90.0070.00317.76
8.1.80.0040.00417.62
8.1.70.0030.00317.68
8.1.60.0050.00517.84
8.1.50.0040.00417.75
8.1.40.0030.00517.88
8.1.30.0040.00417.95
8.1.20.0000.00817.82
8.1.10.0030.00617.78
8.1.00.0000.00817.81
8.0.300.0000.00918.77
8.0.290.0030.00617.00
8.0.280.0000.00818.66
8.0.270.0040.00417.58
8.0.260.0080.00018.58
8.0.250.0050.00217.22
8.0.240.0080.00017.22
8.0.230.0030.00617.29
8.0.220.0030.00617.16
8.0.210.0020.00517.18
8.0.200.0000.00717.23
8.0.190.0040.00417.11
8.0.180.0040.00417.14
8.0.170.0000.00917.22
8.0.160.0040.00417.22
8.0.150.0000.00717.13
8.0.140.0040.00416.97
8.0.130.0050.00013.61
8.0.120.0000.00717.10
8.0.110.0030.00517.23
8.0.100.0000.00716.92
8.0.90.0030.00617.03
8.0.80.0120.00617.10
8.0.70.0030.00517.20
8.0.60.0050.00217.19
8.0.50.0000.00816.92
8.0.30.0130.00917.49
8.0.20.0110.01117.40
8.0.10.0050.00317.13
8.0.00.0090.01117.26
7.4.330.0060.00015.55
7.4.320.0030.00316.68
7.4.300.0070.00016.79
7.4.290.0070.00016.95
7.4.280.0000.01016.79
7.4.270.0000.00816.67
7.4.260.0040.00716.92
7.4.250.0040.00416.87
7.4.240.0040.00416.80
7.4.230.0030.00316.66
7.4.220.0000.00816.89
7.4.210.0090.00616.92
7.4.200.0030.00316.69
7.4.160.0100.00716.89
7.4.140.0110.00917.86
7.4.130.0060.01216.97
7.4.120.0090.00916.76
7.4.110.0130.01016.89
7.4.100.0070.01016.54
7.4.90.0110.00717.06
7.4.80.0030.01719.39
7.4.70.0090.00916.74
7.4.60.0120.00616.83
7.4.50.0080.00817.02
7.4.40.0100.01316.67
7.4.10.0080.00814.75
7.4.00.0080.01015.20
7.3.330.0050.00013.34
7.3.320.0000.00613.39
7.3.310.0060.00316.62
7.3.300.0050.00216.45
7.3.290.0070.00016.49
7.3.280.0090.00816.57
7.3.260.0100.00816.73
7.3.240.0120.00916.71
7.3.230.0170.00016.72
7.3.210.0070.01016.80
7.3.200.0070.01016.72
7.3.190.0120.00916.61
7.3.180.0080.00816.69
7.3.170.0130.01016.61
7.3.160.0050.01816.80
7.3.130.0130.00614.99
7.3.120.0070.01115.12
7.3.110.0050.01215.00
7.3.100.0100.00614.98
7.3.90.0060.00914.97
7.3.80.0070.00614.94
7.3.70.0050.00714.97
7.3.60.0080.00614.92
7.3.50.0060.00914.89
7.3.40.0060.00814.93
7.3.30.0050.00714.94
7.3.20.0060.00816.68
7.3.10.0080.00716.71
7.3.00.0040.00816.71
7.2.330.0100.01016.98
7.2.320.0100.01016.83
7.2.310.0100.00616.84
7.2.300.0030.01316.88
7.2.290.0160.00416.84
7.2.260.0070.01115.36
7.2.250.0100.00815.18
7.2.240.0060.01315.21
7.2.230.0060.01015.08
7.2.220.0090.00415.17
7.2.210.0010.01115.13
7.2.200.0030.01115.22
7.2.190.0060.00815.08
7.2.180.0070.00815.08
7.2.170.0070.00615.16
7.2.160.0100.01015.21
7.2.150.0120.00916.96
7.2.140.0090.01217.09
7.2.130.0030.00916.88
7.2.120.0060.00817.00
7.2.110.0060.00616.73
7.2.100.0050.01216.64
7.2.90.0020.01316.74
7.2.80.0070.00816.79
7.2.70.0080.00716.75
7.2.60.0070.00916.92
7.2.50.0050.01316.84
7.2.40.0040.01116.85
7.2.30.0110.00616.88
7.2.20.0020.01116.85
7.2.10.0060.01116.88
7.2.00.0080.00816.91
7.1.330.0050.01115.91
7.1.320.0050.00615.88
7.1.310.0030.00915.86
7.1.300.0050.01015.80
7.1.290.0060.00715.83
7.1.280.0050.00915.93
7.1.270.0030.01015.79
7.1.260.0060.00815.88
7.1.250.0090.00615.71
7.1.240.0000.01415.87
7.1.230.0120.00315.77
7.1.220.0060.00815.89
7.1.210.0050.00815.77
7.1.200.0070.00815.73
7.1.190.0060.00715.68
7.1.180.0100.00515.78
7.1.170.0070.00815.84
7.1.160.0040.00915.67
7.1.150.0010.01015.82
7.1.140.0090.00415.74
7.1.130.0100.00515.87
7.1.120.0060.00615.70
7.1.110.0090.00515.69
7.1.100.0050.00915.71
7.1.90.0060.00815.70
7.1.80.0070.00715.74
7.1.70.0090.00915.91
7.1.60.0140.01224.86
7.1.50.0100.01224.69
7.1.40.0130.01124.80
7.1.30.0170.00924.70
7.1.20.0160.00724.73
7.1.10.0020.00915.95
7.1.00.0100.00615.80
7.0.330.0120.00015.36
7.0.320.0040.00715.53
7.0.310.0030.01015.58
7.0.300.0070.01015.30
7.0.290.0080.00515.49
7.0.280.0030.01015.32
7.0.270.0000.01115.44
7.0.260.0070.00715.30
7.0.250.0090.00615.24
7.0.240.0040.01115.52
7.0.230.0100.00315.40
7.0.220.0090.00915.34
7.0.210.0080.00415.30
7.0.200.0000.01315.55
7.0.190.0030.00715.48
7.0.180.0130.00315.18
7.0.170.0100.00015.55
7.0.160.0030.00615.52
7.0.150.0140.00715.41
7.0.140.0070.01115.27
7.0.130.0120.00615.55
7.0.120.0060.00915.20
7.0.110.0070.00715.37
7.0.100.0030.00915.59
7.0.90.0100.00315.51
7.0.80.0100.00715.57
7.0.70.0070.00715.44
7.0.60.0000.01115.44
7.0.50.0060.00615.36
7.0.40.0000.01313.46
7.0.30.0120.00313.20
7.0.20.0000.01313.58
7.0.10.0120.00613.45
7.0.00.0090.00613.39
5.6.400.0030.00614.20
5.6.390.0070.01014.05
5.6.380.0070.00814.35
5.6.370.0080.00414.53
5.6.360.0040.01114.32
5.6.350.0100.00614.77
5.6.340.0090.00614.59
5.6.330.0030.01014.48
5.6.320.0060.00914.52
5.6.310.0030.01314.14
5.6.300.0080.00814.54
5.6.290.0070.01114.54
5.6.280.0090.00414.86
5.6.270.0040.00914.50
5.6.260.0060.01014.43
5.6.250.0040.00814.29
5.6.240.0070.01114.64
5.6.230.0110.00414.21
5.6.220.0030.00714.41
5.6.210.0070.00714.25
5.6.200.0100.00314.46
5.6.190.0060.01214.28
5.6.180.0040.01214.19
5.6.170.0060.00914.37
5.6.160.0090.00914.08
5.6.150.0030.01014.16
5.6.140.0120.00014.54
5.6.130.0100.00714.31
5.6.120.0130.00014.34
5.6.110.0030.00914.32
5.6.100.0000.01514.46
5.6.90.0070.01014.32
5.6.80.0030.00714.46
5.6.70.0060.00914.71
5.6.60.0060.00614.58
5.6.50.0110.00314.60
5.6.40.0070.00714.43
5.6.30.0040.01114.14
5.6.20.0050.00514.34
5.6.10.0050.00914.46
5.6.00.0030.00714.65

preferences:
29.82 ms | 401 KiB | 5 Q