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();
Output for git.master_jit, git.master
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <link rel="stylesheet" href="http://%5B::1%5D:5173/app.css"> <script src="https://%5B::1%5D:5173/app.js"></script> </head> <body> <a href="http://%5B::1%5D" data-custom="http://[::1]">anchor</a> <form action="http://%5B::1%5D"></form> <blockquote cite="http://[::1]"></blockquote> </body> </html> string(25) "http://[::1]:5173/app.css" <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>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.96 ms | 479 KiB | 5 Q