3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml=simplexml_load_string(<<<XML <?xml version="1.0"?> <root> <element> <feed id=" 9 "> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> <feed id=" 10 "> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> </element> </root> XML ); function deleteNode($feed_id) { global $xml; $parent=$xml->xpath('[feed[@id=" '.$feed_id.' "]]'); unset($parent[0]); } echo $xml->asXML(); echo "\n"; deleteNode("10"); echo $xml->asXML();
Output for git.master, git.master_jit, rfc.property-hooks
<?xml version="1.0"?> <root> <element> <feed id=" 9 "> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> <feed id=" 10 "> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> </element> </root> Warning: SimpleXMLElement::xpath(): Invalid expression in /in/fJZYf on line 33 Warning: SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed in /in/fJZYf on line 33 Deprecated: Automatic conversion of false to array is deprecated in /in/fJZYf on line 34 <?xml version="1.0"?> <root> <element> <feed id=" 9 "> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> <feed id=" 10 "> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> </element> </root>

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:
43.25 ms | 404 KiB | 8 Q