3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = " <html> <body> <div id='div1'></div> <div id='div2'> Some text <span>Inside a span</span> <div>Nested div</div> </div> <div id='div3'> Some text <span>Inside a span</span> <div>Nested div</div> </div> </body> </html>"; $doc = new DOMDocument(); $doc->loadHTML($html); $div = $doc->getElementById("div2"); $div2 = $doc->getElementById("div3"); echo $div->ownerDocument->saveHTML($div); echo $div2->ownerDocument->saveHTML($div);
Output for git.master, git.master_jit, rfc.property-hooks
<div id="div2"> Some text <span>Inside a span</span> <div>Nested div</div> </div><div id="div2"> Some text <span>Inside a span</span> <div>Nested div</div> </div>

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:
53.42 ms | 401 KiB | 8 Q