3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createNodesFromHTML(DOMDocument $doc,$str) { $nodes = array(); $d = new DOMDocument(); $d->loadHTML("<html>{$str}</html>"); $child = $d->documentElement->firstChild; while($child) { $nodes[] = $doc->importNode($child,true); $child = $child->nextSibling; } return $nodes; } $dom = new DOMDocument(); $icon = '<i class="fa fa-remove"></i>'; $button = $dom->createElement('a'); $button->setAttribute('href', '/offline-bcu/delete/12345'); $button->setAttribute('class', 'ml5 mr5 btn btn-sm btn-danger'); $nodes = createNodesFromHTML($dom, $icon); $button->appendChild($nodes[0]); $dom->appendChild($button); echo $dom->saveHTML();
Output for git.master, git.master_jit, rfc.property-hooks
<a href="/offline-bcu/delete/12345" class="ml5 mr5 btn btn-sm btn-danger"><body><i class="fa fa-remove"></i></body></a>

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