3v4l.org

run code in 300+ PHP versions simultaneously
<?php $codes = <<<'CODES' [column] [row] [column][/column] [column][/column] [/row] [/column] CODES; $html = str_replace(['[', ']'], ['<', '>'], $codes); libxml_use_internal_errors(true); $dom = new \DOMDocument(); $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); foreach($dom->getElementsByTagName('row') as $row) { foreach($row->getElementsByTagName('column') as $column) { $column->appendChild($dom->createTextNode('test')); $column->setAttribute('class', 'test'); } } $tags = getTags($dom->documentElement); echo var_export($tags, true); function getTags($element, $tags = []) { $tag = ['tagName' => $element->tagName]; if ($element->hasAttributes()) { foreach ($element->attributes as $attribute) { $tag['attributes'][$attribute->name] = $attribute->value; } } if ('' !== ($nodeValue = trim($element->textContent)) && false === $element->hasChildNodes()) { $tag['nodeValue'] = $nodeValue; } if ($element->hasChildNodes()) { foreach ($element->childNodes as $childElement) { if ($childElement->nodeType !== XML_ELEMENT_NODE) { continue; } $tag[] = getTags($childElement, $tags); } } $tags[] = $tag; return $tags; }

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.4.120.0120.00820.70
8.4.110.0160.00522.80
8.4.100.0100.01017.86
8.4.90.0150.00618.57
8.4.80.0050.00618.23
8.4.70.0130.00718.21
8.4.60.0110.00919.20
8.4.50.0120.00820.96
8.4.40.0030.01717.71
8.4.30.0120.00619.17
8.4.20.0080.00817.95
8.4.10.0080.00019.63
8.3.250.0110.00819.08
8.3.240.0100.00916.83
8.3.230.0120.00716.75
8.3.220.0040.00419.27
8.3.210.0050.00316.77
8.3.200.0050.00416.83
8.3.190.0100.00917.43
8.3.180.0130.00616.86
8.3.170.0140.00420.89
8.3.160.0090.00917.72
8.3.150.0030.01617.56
8.3.140.0000.00817.52
8.3.130.0100.00018.66
8.3.120.0090.00620.78
8.3.110.0030.00720.94
8.3.100.0030.00624.06
8.3.90.0050.00326.77
8.3.80.0000.01218.55
8.3.70.0080.01318.55
8.3.60.0070.01418.75
8.3.50.0070.01517.09
8.3.40.0100.00324.04
8.3.30.0140.00020.75
8.3.20.0000.00824.18
8.3.10.0090.00923.86
8.3.00.0130.00721.12
8.2.290.0070.00320.82
8.2.280.0130.00718.57
8.2.270.0110.00718.89
8.2.260.0120.00919.39
8.2.250.0040.00417.36
8.2.240.0040.01219.05
8.2.230.0080.00022.58
8.2.220.0000.01037.54
8.2.210.0060.00326.77
8.2.200.0040.00816.75
8.2.190.0090.00618.91
8.2.180.0070.01417.13
8.2.170.0040.01119.09
8.2.160.0100.00722.96
8.2.150.0040.00425.66
8.2.140.0130.00620.59
8.2.130.0040.01120.81
8.2.120.0200.00019.45
8.2.110.0040.01119.43
8.2.100.0150.00819.22
8.2.90.0060.01019.07
8.2.80.0100.01019.20
8.2.70.0100.01018.95
8.2.60.0070.01120.74
8.2.50.0130.00620.87
8.2.40.0150.00420.81
8.2.30.0180.00320.81
8.2.20.0080.00819.06
8.2.10.0090.00618.92
8.2.00.0070.01418.91
8.1.330.0100.01022.29
8.1.320.0080.01316.53
8.1.310.0060.00316.91
8.1.300.0000.00820.63
8.1.290.0040.00730.84
8.1.280.0100.01325.92
8.1.270.0120.00322.31
8.1.260.0100.00622.25
8.1.250.0130.00624.00
8.1.240.0100.00720.65
8.1.230.0150.00818.69
8.1.220.0070.01019.02
8.1.210.0090.00918.67
8.1.200.0100.00018.88
8.1.190.0060.00319.09
8.1.180.0100.01018.71
8.1.170.0070.00318.74
8.1.160.0030.00618.70
8.1.150.0150.00418.91
8.1.140.0070.01018.61
8.1.130.0040.00419.10
8.1.120.0060.00318.92
8.1.110.0120.00318.81
8.1.100.0060.00318.79
8.1.90.0080.00818.83
8.1.80.0090.00618.68
8.1.70.0060.00320.45
8.1.60.0040.00418.79
8.1.50.0160.00018.79
8.1.40.0060.00618.93
8.1.30.0030.00618.84
8.1.20.0060.00318.99
8.1.10.0000.00818.99
8.1.00.0050.00318.68

preferences:
53.94 ms | 403 KiB | 5 Q