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> <?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>'; $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
Warning: DOMDocument::loadXML(): XML declaration allowed only at the start of the document in Entity, line: 13 in /in/SMOft on line 29 Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 14 in /in/SMOft on line 29 <?xml version="1.0"?>

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