3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data=' <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>'; function deleteNode($feed_id) { global $xml; $doc = new SimpleXMLElement($data); foreach($doc->feed as $feed){ if($feed['id'] == $feed_id) { $dom=dom_import_simplexml($feed); $dom->parentNode->removeChild($dom); } } } echo "\n"; deleteNode("10"); echo $xml->asXML();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $data in /in/jZa5O on line 30 Deprecated: SimpleXMLElement::__construct(): Passing null to parameter #1 ($data) of type string is deprecated in /in/jZa5O on line 30 Fatal error: Uncaught Exception: String could not be parsed as XML in /in/jZa5O:30 Stack trace: #0 /in/jZa5O(30): SimpleXMLElement->__construct('') #1 /in/jZa5O(39): deleteNode('10') #2 {main} thrown in /in/jZa5O on line 30
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:
32.96 ms | 402 KiB | 8 Q