3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml="<root><node1>content</node1></root>"; $sxe=new simpleXMLElement($xml); $xml="<root><node1>content</node1></root>"; $sxe=simplexml_load_string($xml); $sxe=simplexml_load_file("filename.xml"); print $sxe->asXML();
Output for 7.0.0 - 7.1.0
Warning: simplexml_load_file(): I/O warning : failed to load external entity "filename.xml" in /in/AkWBZ on line 8 Fatal error: Uncaught Error: Call to a member function asXML() on boolean in /in/AkWBZ:10 Stack trace: #0 {main} thrown in /in/AkWBZ on line 10
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: No such file or directory in /in/AkWBZ on line 8 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function asXML() on a non-object (boolean)' in /in/AkWBZ:10 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Warning: simplexml_load_file(): I/O warning : failed to load external entity "filename.xml" in /in/AkWBZ on line 8 Fatal error: Call to a member function asXML() on boolean in /in/AkWBZ on line 10
Process exited with code 255.
Output for 5.1.0 - 5.5.36
Warning: simplexml_load_file(): I/O warning : failed to load external entity "filename.xml" in /in/AkWBZ on line 8 Fatal error: Call to a member function asXML() on a non-object in /in/AkWBZ on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: I/O warning : failed to load external entity "filename.xml" in /in/AkWBZ on line 8 Fatal error: Call to a member function asXML() on a non-object in /in/AkWBZ on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/AkWBZ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: simplexmlelement in /in/AkWBZ on line 3