3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xsl = <<<EOB <?xml version="1.0" encoding="UTF-8"?> <html xmlns:php="http://php.net/xsl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"> <body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE"> <xsl:for-each select="beers/beer"> <div style="background-color:teal;color:white;padding:4px"> <span style="font-weight:bold"> <xsl:value-of select="name"/> </span> <xsl:value-of select="price"/> </div> <div style="margin-left:20px;margin-bottom:1em;font-size:10pt"> <p> <xsl:value-of select="php:functionString('glob', '*.*')"/> <span style="font-style:italic"> ( <xsl:value-of select="prct"/> %) </span> </p> </div> </xsl:for-each> </body> </html> EOB; $xmldoc = DOMDocument::loadXML("http://challenge01.root-me.org/web-serveur/ch50/beers.xml"); $xsldoc = DOMDocument::loadXML($xsl); $proc = new XSLTProcessor(); $proc->registerPHPFunctions(); $proc->importStyleSheet($xsldoc); echo $proc->transformToXML($xmldoc); foreach (glob("*") as $filename) { echo "$filename occupe " . filesize($filename) . "\n"; } ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught Error: Non-static method DOMDocument::loadXML() cannot be called statically in /in/9mj6r:27 Stack trace: #0 {main} thrown in /in/9mj6r on line 27
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught Error: Non-static method DOMDocument::loadXML() cannot be called statically in /in/9mj6r:27 Stack trace: #0 {main} thrown in /in/9mj6r on line 27
Process exited with code 255.
Output for 7.4.26 - 7.4.33
Deprecated: Non-static method DOMDocument::loadXML() should not be called statically in /in/9mj6r on line 27 Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1 in /in/9mj6r on line 27 Deprecated: Non-static method DOMDocument::loadXML() should not be called statically in /in/9mj6r on line 28 Fatal error: Uncaught Error: Class 'XSLTProcessor' not found in /in/9mj6r:30 Stack trace: #0 {main} thrown in /in/9mj6r on line 30
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.25
Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1 in /in/9mj6r on line 27 Fatal error: Uncaught Error: Class 'XSLTProcessor' not found in /in/9mj6r:30 Stack trace: #0 {main} thrown in /in/9mj6r on line 30
Process exited with code 255.
Output for 5.2.3 - 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.40
Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1 in /in/9mj6r on line 27 Fatal error: Class 'XSLTProcessor' not found in /in/9mj6r on line 30
Process exited with code 255.
Output for 5.1.3 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: DOMDocument::loadXML() [<a href='function.DOMDocument-loadXML'>function.DOMDocument-loadXML</a>]: Start tag expected, '&lt;' not found in Entity, line: 1 in <b>/in/9mj6r</b> on line <b>27</b><br /> <br /> <b>Fatal error</b>: Class 'XSLTProcessor' not found in <b>/in/9mj6r</b> on line <b>30</b><br />
Process exited with code 255.
Output for 5.1.2
<br /> <b>Warning</b>: DOMDocument::loadXML() [<a href='function.loadXML'>function.loadXML</a>]: Start tag expected, '&lt;' not found in Entity, line: 1 in <b>/in/9mj6r</b> on line <b>28</b><br /> <br /> <b>Fatal error</b>: Class 'XSLTProcessor' not found in <b>/in/9mj6r</b> on line <b>31</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
<br /> <b>Warning</b>: DOMDocument::loadXML() [<a href='function.loadXML'>function.loadXML</a>]: Start tag expected, '&lt;' not found in Entity, line: 1 in <b>/in/9mj6r</b> on line <b>27</b><br /> <br /> <b>Fatal error</b>: Class 'XSLTProcessor' not found in <b>/in/9mj6r</b> on line <b>30</b><br />
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
<br /> <b>Fatal error</b>: Undefined class name 'domdocument' in <b>/in/9mj6r</b> on line <b>27</b><br />
Process exited with code 255.
Output for 4.4.2
<br /> <b>Fatal error</b>: Undefined class name 'domdocument' in <b>/in/9mj6r</b> on line <b>28</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Undefined class name 'domdocument' in <b>/in/9mj6r</b> on line <b>27</b><br />

preferences:
302.39 ms | 401 KiB | 468 Q