3v4l.org

run code in 300+ PHP versions simultaneously
<?php // "Create" the document. $xml = new DOMDocument( "1.0", "ISO-8859-15" ); //to have indented output, not just a line $xml->preserveWhiteSpace = false; $xml->formatOutput = true; // ------------- Interresting part here ------------ //creating an xslt adding processing line $xslt = $xml->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="base.xsl"'); //adding it to the xml $xml->appendChild($xslt); // ----------- / Interresting part here ------------- //adding some elements $root = $xml->createElement("list"); $node = $xml->createElement("contact", "John Doe"); $root-> appendChild($node); $xml-> appendChild($root); //creating the file $xml-> save("output.xml"); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: DOMDocument::save(): open_basedir restriction in effect. File(output.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/3es0t on line 27 Warning: DOMDocument::save(output.xml): Failed to open stream: Operation not permitted in /in/3es0t on line 27

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