3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A {} $a = new DOMDocument(); var_dump($a->saveXML(new A()));
Output for 7.1.0
Fatal error: Uncaught TypeError: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode or null, instance of A given in /in/GMXNE:4 Stack trace: #0 /in/GMXNE(4): DOMDocument->saveXML(Object(A)) #1 {main} thrown in /in/GMXNE on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Fatal error: Uncaught TypeError: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode, instance of A given in /in/GMXNE:4 Stack trace: #0 /in/GMXNE(4): DOMDocument->saveXML(Object(A)) #1 {main} thrown in /in/GMXNE on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0

Process exited with code 139.
Output for 5.2.6 - 5.6.28
Catchable fatal error: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode, instance of A given in /in/GMXNE on line 4
Process exited with code 255.
Output for 5.0.5 - 5.2.5
Warning: DOMDocument::saveXML() expects parameter 1 to be DOMNode, object given in /in/GMXNE on line 4 NULL
Output for 5.0.0 - 5.0.4
Warning: saveXML() expects parameter 1 to be DOMNode, object given in /in/GMXNE on line 4 NULL
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/GMXNE on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/GMXNE on line 3