3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = ' <GetCategories> <GetProduct> <Data> <Id>87772873</Id> <Name>Foods and Beverages</Name> <Top> <CategoryId>028392323</CategoryId> <CategoryName>Categories</CategoryName> </Top> </Data> </GetProduct> </GetCategories> '; $dom = new DOMDocument; $dom->loadXML($xml); $dom->preserveWhiteSpace = FALSE; $Xpath = new DOMXpath($dom); foreach ($Xpath->evaluate('/GetCategories/GetProduct/Data/Top[1]') as $data) { $type = $data->appendChild($dom->createElement('TypeId')); $type->appendChild($dom->createTextNode('HDU5K3KDI23F')); } $xmldata = $dom->saveXML(); echo $xmldata;
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0"?> <GetCategories> <GetProduct> <Data> <Id>87772873</Id> <Name>Foods and Beverages</Name> <Top> <CategoryId>028392323</CategoryId> <CategoryName>Categories</CategoryName> <TypeId>HDU5K3KDI23F</TypeId></Top> </Data> </GetProduct> </GetCategories>

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:
28.97 ms | 406 KiB | 5 Q