3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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); define('START_TIME', microtime(1)); /* 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(); var_dump(microtime(1) - START_TIME);
Output for 7.0.5 - 7.1.0
Deprecated: Non-static method DOMDocument::loadXML() should not be called statically in /in/jErjN on line 11 Notice: Undefined variable: u in /in/jErjN on line 19 Fatal error: Uncaught Error: Call to a member function isRegistered() on null in /in/jErjN:19 Stack trace: #0 {main} thrown in /in/jErjN on line 19
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Deprecated: Non-static method DOMDocument::loadXML() should not be called statically in /in/jErjN on line 11 Notice: Undefined variable: u in /in/jErjN on line 19 Fatal error: Uncaught Error: Call to a member function isRegistered() on unknown in /in/jErjN:19 Stack trace: #0 {main} thrown in /in/jErjN on line 19
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: u in /in/jErjN on line 19 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function isRegistered() on a non-object (null)' in /in/jErjN:19 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/jErjN on line 11 Notice: Undefined variable: u in /in/jErjN on line 19 Fatal error: Call to a member function isRegistered() on null in /in/jErjN on line 19
Process exited with code 255.
Output for 5.0.4 - 5.1.1, 5.1.3 - 5.5.38
Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/jErjN on line 11 Notice: Undefined variable: u in /in/jErjN on line 19 Fatal error: Call to a member function isRegistered() on a non-object in /in/jErjN on line 19
Process exited with code 255.
Output for 5.1.2
Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/jErjN on line 12 Notice: Undefined variable: u in /in/jErjN on line 20 Fatal error: Call to a member function isRegistered() on a non-object in /in/jErjN on line 20
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/jErjN on line 11 Notice: Undefined variable: u in /in/jErjN on line 19 Fatal error: Call to a member function isRegistered() on a non-object in /in/jErjN on line 19
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.9
Fatal error: Undefined class name 'domdocument' in /in/jErjN on line 11
Process exited with code 255.
Output for 4.4.2
Fatal error: Undefined class name 'domdocument' in /in/jErjN on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'domdocument' in /in/jErjN on line 11