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(); $f->appendXML('<a href="#url">' . 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.0 - 7.1.0
Deprecated: Non-static method DOMDocument::loadXML() should not be called statically in /in/rpVJR on line 11 Fatal error: Uncaught Error: Call to undefined function t() in /in/rpVJR:20 Stack trace: #0 {main} thrown in /in/rpVJR on line 20
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Uncaught Error: Call to undefined function t() in /in/rpVJR:20 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: Call to undefined function t() in /in/rpVJR on line 20
Process exited with code 255.
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.6.28
Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/rpVJR on line 11 Fatal error: Call to undefined function t() in /in/rpVJR on line 20
Process exited with code 255.
Output for 5.1.2
Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/rpVJR on line 12 Fatal error: Call to undefined function t() in /in/rpVJR on line 21
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/rpVJR on line 11 Fatal error: Call to undefined method DOMDocumentFragment::appendXML() in /in/rpVJR on line 20
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/rpVJR on line 11
Process exited with code 255.
Output for 4.4.2
Fatal error: Undefined class name 'domdocument' in /in/rpVJR on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'domdocument' in /in/rpVJR on line 11