3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $xml = simplexml_load_string("<div>444444444444<a href=\"https://zupa.com?a=1&b=2\">test</a>33333333</div>", "SimpleXMLElement", LIBXML_NOWARNING | LIBXML_NOERROR); $xmlOutput = dom_import_simplexml($xml); $xmlOutput = $xmlOutput->ownerDocument->saveXML($xmlOutput->ownerDocument->documentElement); echo $xmlOutput; echo "11111";
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught TypeError: dom_import_simplexml(): Argument #1 ($node) must be of type object, false given in /in/EDULB:6 Stack trace: #0 /in/EDULB(6): dom_import_simplexml(false) #1 {main} thrown in /in/EDULB on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30
Fatal error: Uncaught TypeError: dom_import_simplexml(): Argument #1 ($node) must be of type object, bool given in /in/EDULB:6 Stack trace: #0 /in/EDULB(6): dom_import_simplexml(false) #1 {main} thrown in /in/EDULB on line 6
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Warning: dom_import_simplexml() expects parameter 1 to be object, bool given in /in/EDULB on line 6 Notice: Trying to get property 'ownerDocument' of non-object in /in/EDULB on line 7 Fatal error: Uncaught Error: Call to a member function saveXML() on null in /in/EDULB:7 Stack trace: #0 {main} thrown in /in/EDULB on line 7
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Warning: dom_import_simplexml() expects parameter 1 to be object, bool given in /in/EDULB on line 6 Fatal error: Uncaught Error: Call to a member function saveXML() on null in /in/EDULB:7 Stack trace: #0 {main} thrown in /in/EDULB on line 7
Process exited with code 255.
Output for 7.2.0 - 7.2.33
Warning: dom_import_simplexml() expects parameter 1 to be object, boolean given in /in/EDULB on line 6 Notice: Trying to get property 'ownerDocument' of non-object in /in/EDULB on line 7 Fatal error: Uncaught Error: Call to a member function saveXML() on null in /in/EDULB:7 Stack trace: #0 {main} thrown in /in/EDULB on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Warning: dom_import_simplexml() expects parameter 1 to be object, boolean given in /in/EDULB on line 6 Notice: Trying to get property of non-object in /in/EDULB on line 7 Fatal error: Uncaught Error: Call to a member function saveXML() on null in /in/EDULB:7 Stack trace: #0 {main} thrown in /in/EDULB on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Warning: dom_import_simplexml() expects parameter 1 to be object, boolean given in /in/EDULB on line 6 Notice: Trying to get property of non-object in /in/EDULB on line 7 Fatal error: Call to a member function saveXML() on null in /in/EDULB on line 7
Process exited with code 255.
Output for 5.1.0 - 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
Warning: dom_import_simplexml() expects parameter 1 to be object, boolean given in /in/EDULB on line 6 Notice: Trying to get property of non-object in /in/EDULB on line 7 Fatal error: Call to a member function saveXML() on a non-object in /in/EDULB on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Notice: Use of undefined constant LIBXML_NOWARNING - assumed 'LIBXML_NOWARNING' in /in/EDULB on line 5 Notice: Use of undefined constant LIBXML_NOERROR - assumed 'LIBXML_NOERROR' in /in/EDULB on line 5 Warning: simplexml_load_string() expects at most 2 parameters, 3 given in /in/EDULB on line 5 Warning: dom_import_simplexml() expects parameter 1 to be object, null given in /in/EDULB on line 6 Notice: Trying to get property of non-object in /in/EDULB on line 7 Fatal error: Call to a member function saveXML() on a non-object in /in/EDULB on line 7
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/EDULB on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/EDULB on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/EDULB on line 4

preferences:
116.21 ms | 2784 KiB | 4 Q