3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<products><product><features><feature>Dimensions:300x1220x12:8</feature><feature>Weight:25kg:853</feature></features></product></products>'; $doc = new DOMDocument('1.0', 'UTF-8'); $doc->loadXML($xml); foreach($doc->getElementsByTagName('feature') as $featureNode) { $values = explode(':', $featureNode->textContent); $newNode = $doc->createElement($values[0]); $newNode->appendChild($doc->createTextNode($values[1])); $featureNode->removeChild($featureNode->firstChild); $featureNode->appendChild($newNode); } $doc->formatOutput = true; echo $doc->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0"?> <products> <product> <features> <feature> <Dimensions>300x1220x12</Dimensions> </feature> <feature> <Weight>25kg</Weight> </feature> </features> </product> </products>

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