3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?><html> <head> <title>Waa?</title> </head> <body> <ul> <li><img src="http://i.mg" alt="waa?" /><li /></li> </ul> </body> </html>'; /* $doc = new DOMDocument('1.0', 'UTF-8'); $doc->resolveExternals = true; $doc->loadXML($xml); $doc->validate(); */ $root = 'html'; $systemId = "http://office.react.nl/~arjen/php/xhtml1-transitional.dtd"; $creator = new DOMImplementation; $doctype = $creator->createDocumentType($root, null, $systemId); $new = $creator->createDocument(null, null, $doctype); $new->encoding = "utf-8"; $new->resolveExternals = true; var_dump($new->doctype === $doctype); $new->loadXML($xml); var_dump($new->doctype === $doctype); $new->validate();
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: DOMImplementation::createDocumentType(): Passing null to parameter #2 ($publicId) of type string is deprecated in /in/hrYHn on line 24 Deprecated: DOMImplementation::createDocument(): Passing null to parameter #2 ($qualifiedName) of type string is deprecated in /in/hrYHn on line 25 bool(true) bool(false) Warning: DOMDocument::validate(): no DTD found! in /in/hrYHn on line 31

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:
44.29 ms | 402 KiB | 8 Q