3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?>' . '<b:book xmlns:b="urn:irrelevant">' . '<b:chapter>Once upon a time</b:chapter>' . '</b:book>'; $doc = new DOMDocument(); $doc->loadXML($xml); $book = $doc->documentElement; $chapter = $book->getElementsByTagName("chapter")->item(0); echo "book nsURI before: ", $book->namespaceURI, "\n"; // prints "book nsURI before: urn:irrelevant" $nsuri = $book->namespaceURI; $book->removeChild($chapter); echo "book nsURI after: ", $book->namespaceURI, "\n"; // prints "book nsURI after: urn:irrelevant" // fails with "Cannot write property" $book->namespaceURI = $nsuri;
Output for git.master, git.master_jit, rfc.property-hooks
book nsURI before: urn:irrelevant book nsURI after: urn:irrelevant Fatal error: Uncaught Error: Cannot write read-only property DOMElement::$namespaceURI in /in/SbSPO:22 Stack trace: #0 {main} thrown in /in/SbSPO on line 22
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:
37.34 ms | 401 KiB | 8 Q