3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = '<items><item/><item/><item/></items>'; $dom = DOMDocument::loadXml($xm); var_dump(iterator_to_array($dom->documentElement->childNodes));
Output for 7.0.0 - 7.1.0
Deprecated: Non-static method DOMDocument::loadXML() should not be called statically in /in/9elad on line 5 Notice: Undefined variable: xm in /in/9elad on line 5 Warning: DOMDocument::loadXML(): Empty string supplied as input in /in/9elad on line 5 Notice: Trying to get property of non-object in /in/9elad on line 8 Notice: Trying to get property of non-object in /in/9elad on line 8 Fatal error: Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, null given in /in/9elad:8 Stack trace: #0 /in/9elad(8): iterator_to_array(NULL) #1 {main} thrown in /in/9elad on line 8
Process exited with code 255.
Output for 5.2.0 - 5.6.28
Notice: Undefined variable: xm in /in/9elad on line 5 Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/9elad on line 5 Warning: DOMDocument::loadXML(): Empty string supplied as input in /in/9elad on line 5 Notice: Trying to get property of non-object in /in/9elad on line 8 Notice: Trying to get property of non-object in /in/9elad on line 8 Catchable fatal error: Argument 1 passed to iterator_to_array() must implement interface Traversable, null given in /in/9elad on line 8
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Notice: Undefined variable: xm in /in/9elad on line 5 Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/9elad on line 5 Warning: DOMDocument::loadXML(): Empty string supplied as input in /in/9elad on line 5 Notice: Trying to get property of non-object in /in/9elad on line 8 Notice: Trying to get property of non-object in /in/9elad on line 8 Warning: iterator_to_array() expects parameter 1 to be Traversable, null given in /in/9elad on line 8 bool(false)
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: xm in /in/9elad on line 5 Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/9elad on line 5 Warning: DOMDocument::loadXML(): Empty string supplied as input in /in/9elad on line 5 Fatal error: Call to undefined function iterator_to_array() in /in/9elad on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: xm in /in/9elad on line 5 Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically in /in/9elad on line 5 Warning: DOMDocument::loadXML(): Empty string supplied as input in /in/9elad on line 5 Fatal error: Call to undefined function iterator_to_array() in /in/9elad on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Undefined class name 'domdocument' in /in/9elad on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'domdocument' in /in/9elad on line 5