3v4l.org

run code in 300+ PHP versions simultaneously
<?php // "Create" the document. $xml = new DOMDocument( "1.0", "ISO-8859-15" ); $xml->xmlVersion = null; $xml->standalone = true; $xml->doctype = null; // Create some elements. $xml_album = $xml->createElement( "Album" ); $xml_track = $xml->createElement( "Track", "The ninth symphony" ); // Set the attributes. $xml_track->setAttribute( "length", "0:01:15" ); $xml_track->setAttribute( "bitrate", "64kb/s" ); $xml_track->setAttribute( "channels", "2" ); // Create another element, just to show you can add any (realistic to computer) number of sublevels. $xml_note = $xml->createElement( "Note", "The last symphony composed by Ludwig van Beethoven." ); // Append the whole bunch. $xml_track->appendChild( $xml_note ); $xml_album->appendChild( $xml_track ); // Repeat the above with some different values.. $xml_track = $xml->createElement( "Track", "Highway Blues" ); $xml_track->setAttribute( "length", "0:01:33" ); $xml_track->setAttribute( "bitrate", "64kb/s" ); $xml_track->setAttribute( "channels", "2" ); $xml_album->appendChild( $xml_track ); $xml->appendChild( $xml_album ); // Parse the XML. print $xml->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot write read-only property DOMDocument::$doctype in /in/rr1vI:8 Stack trace: #0 {main} thrown in /in/rr1vI on line 8
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:
54.2 ms | 401 KiB | 8 Q