3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<T <data> <Report ID="1"> <Date>Review</Date> <vt:lpstr>2</vt:lpstr> </Report> </data> T; $xmlDoc = new DOMDocument(); $xmlDoc->loadXML( $xml ); $searchNode = $xmlDoc->getElementsByTagName( "Report" ); foreach( $searchNode as $searchNode ) { $valueID = $searchNode->getAttribute('ID'); $xmlDate = $searchNode->getElementsByTagName("Date"); $valueDate = $xmlDate->item(0)->nodeValue; $xmlvtlpstr = $searchNode->getElementsByTagName( "vt:lpstr"); $newelement = $xmlvtlpstr->createTextNode('xmlvtlpstr'); $searchNode->replaceChild($xmlvtlpstr, $newelement); $valuevtlpstr = $xmlvtlpstr->item(0)->nodeValue; echo "$valueID - $valueDate - $valuevtlpstr\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: DOMDocument::loadXML(): Namespace prefix vt on lpstr is not defined in Entity, line: 4 in /in/r339d on line 11 Fatal error: Uncaught Error: Call to undefined method DOMNodeList::createTextNode() in /in/r339d:23 Stack trace: #0 {main} thrown in /in/r339d on line 23
Process exited with code 255.

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