3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<div id="demo">à la téléchargez mêmes</div>'; $doc = new DOMDocument(); $doc->encoding = 'utf-8'; $saved = libxml_use_internal_errors(true); $result = $doc->loadHTML('<?xml>' . $html); libxml_use_internal_errors($saved); if ($result) { $removed = $doc->removeChild($doc->documentElement->previousSibling); } var_dump(get_class($removed)); $xpath = new DOMXpath($doc); echo $xpath->query("//div[@id='demo']")->item(0)->nodeValue; echo "\n"; $doc->saveHTMLFile('php://output');
Output for git.master, git.master_jit, rfc.property-hooks
string(24) "DOMProcessingInstruction" à la téléchargez mêmes <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><div id="demo">&agrave; la t&eacute;l&eacute;chargez m&ecirc;mes</div></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:
29.96 ms | 406 KiB | 5 Q