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); 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.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.24, 7.3.0 - 7.3.12
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 5.1.0 - 5.1.1, 5.1.3 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 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.3.11, 4.4.0 - 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

preferences:
179.43 ms | 401 KiB | 262 Q