3v4l.org

run code in 300+ PHP versions simultaneously
<?php $aDOM = new DOMDocument(); $aDOM->loadXML('<f2f:o xmlns:f2f=" http://friend2friend.net " xmlns:default="default"><default:i xmlns="default"><f2f:watch-me/></default:i></f2f:o>'); echo 'Initial DOM is '.$aDOM->saveXML().chr(13); $newNode= $aDOM->createElementNS(" http://friend2friend.net ", 'newnode'); $newNode->appendChild($aDOM->documentElement); echo 'Appending the document Element to f2f:newnode, it all looks OK: '.chr(13).$aDOM->saveXML($newNode).chr(13).chr(13); $aDOM->appendChild($newNode); echo 'But adding <f2f:newnode> back as the documentElement changes a namespace '.$aDOM->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: DOMDocument::loadXML(): xmlns:f2f: ' http://friend2friend.net ' is not a valid URI in Entity, line: 1 in /in/93fde on line 3 Notice: DOMDocument::loadXML(): xmlns: URI default is not absolute in Entity, line: 1 in /in/93fde on line 3 Initial DOM is <?xml version="1.0"?> <f2f:o xmlns:f2f=" http://friend2friend.net " xmlns:default="default"><default:i xmlns="default"><f2f:watch-me/></default:i></f2f:o> Appending the document Element to f2f:newnode, it all looks OK: <newnode xmlns=" http://friend2friend.net "><f2f:o xmlns:f2f=" http://friend2friend.net " xmlns:default="default"><default:i xmlns="default"><f2f:watch-me/></default:i></f2f:o></newnode> But adding <f2f:newnode> back as the documentElement changes a namespace <?xml version="1.0"?> <newnode xmlns=" http://friend2friend.net " xmlns:default="default"><o xmlns:f2f=" http://friend2friend.net " xmlns:default="default"><default:i xmlns="default"><watch-me/></default:i></o></newnode>

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:
63.89 ms | 403 KiB | 8 Q