3v4l.org

run code in 300+ PHP versions simultaneously
<?php //creating an XML document $dom = new DOMDocument('1.0'); $dom->xmlStandalone = false; //create element manifest $manfiestNode = $dom->createElement('manifest',""); $dom->importNode($manfiestNode); //create attribute identifier $manfiestNodeAttr = $dom->createAttribute('identifier'); //value for the manifest node identifier value $date = new DateTime(); $manfiestNodeAttr->value = 'course_'.date_format($date,'U'); //append attribute to the manifest element $manfiestNode->appendChild($manfiestNodeAttr); $manfiestNode->appendChild($dom->createAttribute('xmlns:xsi'))->appendChild($dom->createTextNode("http://www.w3.org/2001/XMLSchema-instance")); //add metadata element under manifest node $metaData = $dom->createElement('metadata',''); //add metadata element to manifest node $manfiestNode->appendChild($metaData); //create schema and schemaversion element under metatag $schema = $dom->createElement('schema','ADL SCORM'); $schemaVersion = $dom->createElement('schemaversion', '2004 3rd Edition'); //create schema and schemaversion element under metatag $metaData->appendChid($schema); $metaData->appendChid($schemaVersion); //append manifest element to the document $dom->appendChild($manfiestNode); var_dump($dom->saveXML());
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined method DOMElement::appendChid() in /in/5BhgC:34 Stack trace: #0 {main} thrown in /in/5BhgC on line 34
Process exited with code 255.

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