3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $html = <<<HTML <form method="post" class="form" data-id="19" data-title="Schema" data-slug="schema" data-message-success="Success!" data-message-invalid-email="Not valid!" data-message-required-field-missing="All fields are required!" data-message-error="Error!"> --- Form content --- <div>with some tags</div> </form> HTML; $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadHTML($html); $xpath = new DOMXPath($doc); foreach ($xpath->query('//form') as $formTag) { // remove child nodes of the form tag foreach ([...$formTag->childNodes] as $child) { $formTag->removeChild($child); } // output as string, but remove the closing tag echo substr($doc->saveHTML($formTag), 0, -7); }
Output for git.master, git.master_jit, rfc.property-hooks
<form method="post" class="form" data-id="19" data-title="Schema" data-slug="schema" data-message-success="Success!" data-message-invalid-email="Not valid!" data-message-required-field-missing="All fields are required!" data-message-error="Error!">

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:
147.39 ms | 406 KiB | 5 Q