3v4l.org

run code in 300+ PHP versions simultaneously
<?php class XMLCreator { private $data = Array ( "zipcode" => "95610", "city" => "Citrus Heights", "icao" => "KMCC", "ccobst" => "McClellan Airfield", "obdist" => 7.3067011821565, "oblat" => 38.667, "oblong" => -121.4, ); function __construct() { $this->generate_xml_element(); } function __destruct() { } function generate_xml_element() { $doc = new DOMDocument(); // we want a nice output $doc->formatOutput = true; $root = $doc->createElement('address'); $root = $doc->appendChild($root); foreach ($this->data as $key => $value) { $title = $doc->createElement($key); $title = $root->appendChild($title); $text = $doc->createTextNode($value); $text = $title->appendChild($text); } echo "Saving all the document:\n"; echo $doc->saveXML() . "\n"; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks

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