3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <footer xmlns:t="ddtemplate"> <p> <t:span child="sign-in" class="sign-in" /> <t:span child="copyright" class="footer-copyright" /> </p> </footer> XML; $doc = DOMDocument::loadXML($xml); /* Template Values */ $tv = array(); $f = $doc->createDocumentFragment(); if ($u->isRegistered()) { if (Config::get("ENABLE_USER_PROFILES")) { $userName = '<a href="' . $this->url('/profile') . '">' . $u->getUserName() . '</a>'; } else { $userName = $u->getUserName(); } $f->appendXML(t('Currently logged in as <b>%s</b>.', $userName) . '<a href="' . $this->url('/login', 'logout') . '">' . t('Sign Out') . '</a>'); } else { $f->appendXML('<a href="' . $this->url('/login') . '">' . t('Sign In to Edit this Site') . '</a>'); } $tv['sign-in'] = $f; $tv['copyright'] = $doc->createTextNode('&copy;' . date('Y') . ' ' . SITE); foreach($doc->getElementsByTagNameNS('ddtemplate','*') as $el) { $el->appendChild($tv[$el->getAttribute('child')]); } echo $doc->saveHTML();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Non-static method DOMDocument::loadXML() cannot be called statically in /in/bg2ZG:11 Stack trace: #0 {main} thrown in /in/bg2ZG on line 11
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:
39.06 ms | 401 KiB | 8 Q