3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <desc> These are the <special>&lt;best&gt;</special> chocolate chip cookies <special>&lt;EVER&gt;</special> </desc> XML; $sx = new SimpleXMLElement($xml); $dom = dom_import_simplexml($sx); $html = ''; foreach($dom->childNodes as $node) { switch($node->nodeType) { case XML_ELEMENT_NODE: if($node->tagName=='special') $html .= '<em>'.htmlspecialchars($node->textContent).'</em>'; break; case XML_TEXT_NODE: $html .= htmlspecialchars($node->data); break; } } echo trim($html);

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.5.10.0060.01118.45
8.5.00.0110.01020.21
8.4.160.0140.00924.02
8.4.150.0010.00114.05
8.4.140.0120.00917.75
8.4.130.0090.01118.90
8.4.120.0060.00224.56
8.4.110.0110.00919.18
8.4.100.0060.00618.96
8.4.90.0070.00421.02
8.4.80.0040.00418.77
8.4.70.0120.00819.21
8.4.60.0090.01319.14
8.4.50.0130.00818.85
8.4.40.0040.01617.99
8.4.30.0030.00620.63
8.4.20.0100.00721.48
8.4.10.0130.00719.47
8.3.280.0110.01018.52
8.3.270.0160.00616.66
8.3.260.0110.00816.82
8.3.250.0100.00819.16
8.3.240.0120.00617.23
8.3.230.0120.00617.33
8.3.220.0120.00719.09
8.3.210.0040.00418.89
8.3.200.0070.00216.79
8.3.190.0080.01119.00
8.3.180.0060.00216.76
8.3.170.0110.00817.48
8.3.160.0070.00720.78
8.3.150.0040.01517.54
8.3.140.0080.01018.17
8.3.130.0090.00616.92
8.3.120.0090.00016.74
8.3.50.0060.01216.93
8.2.290.0040.00520.57
8.2.280.0050.00318.89
8.2.270.0040.01116.55
8.2.260.0110.00719.11
8.2.250.0040.00718.36
8.1.330.0150.00422.23
8.1.320.0060.00317.99
8.1.310.0040.00417.27

preferences:
35.32 ms | 403 KiB | 5 Q