3v4l.org

run code in 500+ PHP versions simultaneously
<?php $xml = new DOMDocument; $xslt = $xml->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="xml2html.xsl"'); $xml->appendChild($xslt); $xml->appendChild( $xml->importNode( (new DOMDocument)->loadXml('<foo>Foo</foo>') ) ); echo $xml->saveXML();
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught TypeError: DOMDocument::importNode(): Argument #1 ($node) must be of type DOMNode, true given in /in/p9JCg:8 Stack trace: #0 /in/p9JCg(8): DOMDocument->importNode(true) #1 {main} thrown in /in/p9JCg on line 8
Process exited with code 255.
Output for 8.2.0 - 8.2.30
Fatal error: Uncaught TypeError: DOMDocument::importNode(): Argument #1 ($node) must be of type DOMNode, bool given in /in/p9JCg:8 Stack trace: #0 /in/p9JCg(8): DOMDocument->importNode(true) #1 {main} thrown in /in/p9JCg on line 8
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34
Fatal error: Uncaught TypeError: DOMDocument::importNode(): Argument #1 ($node) must be of type DOMNode, bool given in /in/p9JCg:9 Stack trace: #0 /in/p9JCg(9): DOMDocument->importNode(true) #1 {main} thrown in /in/p9JCg on line 9
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to DOMDocument::importNode() must be an instance of DOMNode, bool given in /in/p9JCg:9 Stack trace: #0 /in/p9JCg(9): DOMDocument->importNode(true) #1 {main} thrown in /in/p9JCg on line 9
Process exited with code 255.
Output for 7.0.0 - 7.0.25, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Fatal error: Uncaught TypeError: Argument 1 passed to DOMDocument::importNode() must be an instance of DOMNode, boolean given in /in/p9JCg:9 Stack trace: #0 /in/p9JCg(9): DOMDocument->importNode(true) #1 {main} thrown in /in/p9JCg on line 9
Process exited with code 255.

preferences:
92.41 ms | 1729 KiB | 4 Q