3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<EOD <html> <head> <link rel="stylesheet" href="http://[::1]:5173/app.css"/> <script src="https://[::1]:5173/app.js"></script> </head> <body> <a href="http://[::1]" data-custom="http://[::1]">anchor</a> <form action="http://[::1]"></form> <blockquote cite="http://[::1]"></blockquote> </body> </html> EOD; $document = new DOMDocument(); $document->loadHTML($html, LIBXML_HTML_NOIMPLIED); print $document->saveHTML(); print "\n"; // internally it is represented correctly $link = $document->getElementsByTagName('link')->item(0)->getAttribute('href'); var_dump($link); print "\n"; // Dom\HTMLDocument works fine $htmldocument = Dom\HTMLDocument::createFromString($html, LIBXML_HTML_NOIMPLIED); print $htmldocument->saveHTML();

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.30.0050.00518.09
8.5.20.0120.00718.95
8.4.180.0120.01120.44
8.4.170.0120.01022.13
8.4.90.0110.00920.16
8.3.300.0120.00820.55
8.3.180.0130.00718.79
8.3.50.0120.00817.07

preferences:
42.97 ms | 475 KiB | 5 Q