3v4l.org

run code in 300+ PHP versions simultaneously
<?php $buffer = <<<BUFFER <?xml version="1.0"?> <favorites> <favorite> <name>http://www.youtub</name> <url>http://www.youtube.com/watch?v=KY224sdWSxA</url> <id>1</id> </favorite> </favorites> BUFFER; $xml = new DOMDocument(); $xml->formatOutput = TRUE; $xml->preserveWhiteSpace = FALSE; $xml->loadXML($buffer); $name = 'http://www.youtube.com'; $url = 'http://www.youtube.com/watch?v=hgfhagdfah'; $id = '2'; $favTag = $xml->createElement('favorite'); $nameTag = $xml->createElement('name'); $nameTag->nodeValue = $name; $favTag->appendChild($nameTag); $favorites = $xml->getElementsByTagname('favorites')->item(0); // root element $favorites->appendChild($favTag); echo $xml->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0"?> <favorites> <favorite> <name>http://www.youtub</name> <url>http://www.youtube.com/watch?v=KY224sdWSxA</url> <id>1</id> </favorite> <favorite> <name>http://www.youtube.com</name> </favorite> </favorites>

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